Examveda
Examveda

What is the result of the following code snippet?

try {
int[] arr = new int[5];
int value = arr[10];
} catch (ArrayIndexOutOfBoundsException e) {
System.out.println("Exception Caught!");
}

A. Compilation error

B. Exception Caught!

C. Runtime exception

D. Compilation error

Answer: Option B


This Question Belongs to Java Program >> Exceptions

Join The Discussion

Related Questions on Exceptions