0
What is the output of the following Java program?
public class Main {
public static void main(String[] args) {
try {
int[] a = new int[2];
a[2] = 5;
System.out.print("A");
} catch (ArithmeticException e) {
System.out.print("X");
} catch (ArrayIndexOutOfBoundsException e) {
System.out.print("B");
} finally {
System.out.print("C");
}
System.out.print("D");
}
}- AACD
- BXCD
- CBD
- DBCD
Correct answer: D