Given the class ExceptionExample below, answer the following questions:
public class ExceptionExample {
public static void main(String [] args) {
methodX();
try {
methodY();
} catch (ArrayIndexOutOfBoundsException aiobe) {
System.out.println("Error 1");
} catch (ArithmeticException ae) {
System.out.println("Error 2");
} finally {
System.out.println("Done");
}
}
public static void methodX() {
// Line A
try {
// Line B
} catch (NullPointerException npe) {
System.out.println(npe.getMessage());
}
}
public static void methodY() {
// Line C
try {
// Line D
methodZ();
} catch (NullPointerException npe) {
System.out.println("Error 3");
} catch (ArrayIndexOutOfBoundsException aiobe) {
System.out.println("Error 4");
}
System.out.println("Done methodY");
}
public static void methodZ() {
// Line E
try {
// Line F
} catch (ArrayIndexOutOfBoundsException aiobe) {
System.out.println(aiobe.getMessage());
} catch (NumberFormatException nfe) {
System.out.println("Error 5");
return;
} finally {
System.out.println("Done methodZ");
}
}
}