public class exdemo1 {
public static void main(String args[]) {
int a = 10, b = 0, ans;
int arr[] = {10, 20, 30};
try {
ans = a / b;
System.out.println("Division" + ans);
System.out.println("4th Element" + arr[3]);
} catch (ArithmeticException ae) ;
{
System.out.println(ae);
}
catch (ArrayindexoutofboundsException ae) {
System.out.println(ae);
}
}
}
public class exdemo1 { public static void main(String args[]) { int a = 10,
Share
Now that your code is properly formatted, you will probably notice an extra
;after the first catch block.