Question: 45
(Choose 1 answer)
What will be the output of the following code?
A. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
B. arr[10]=10
Finished!
C. Khối lệnh finally
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
D. arr[10] 10
Khối lệnh finally
Finished!
public class Ex1 {
public static void main(String[] args) {
try {
int intArr[] = new int[10];
intArr [10] = 10;
"
System.out.println("arr[10] = + intArr [9]);
} catch (NullPointerException ex) {
} finally {
System.out.println(ex);
System.out.println("Finally statement");
}
}
}
System.out.println("Finished!");