Exception

public class ContohException
{
public static void main(String[]args)
{
int x = 12;
int y = 0;
int z = 6;

try
{
System.out.println((x+z)/y);
}
catch(Exception ex)
{
System.out.println(“Gak bisa di bagi nol”);
}
}
}

Leave a comment