What is the result of the following code snippet?
try {
int num = 10 / 0;
} catch (ArithmeticException e) {
System.out.println("Arithmetic Exception!");
} catch (Exception e) {
System.out.println("Exception!");
}
int num = 10 / 0;
} catch (ArithmeticException e) {
System.out.println("Arithmetic Exception!");
} catch (Exception e) {
System.out.println("Exception!");
}
A. Exception!
B. No output
C. Compilation error
D. Arithmetic Exception!
Answer: Option D
Join The Discussion