Java - Exception Handling
What will be the output of this code?
try {
int a = 5 / 0;
} catch (ArithmeticException e) {
System.out.println("Arithmetic Exception caught");
} catch (Exception e) {
System.out.println("General Exception caught");
}What will be the output of this code?
try {
int a = 5 / 0;
} catch (ArithmeticException e) {
System.out.println("Arithmetic Exception caught");
} catch (Exception e) {
System.out.println("General Exception caught");
}15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions