Examveda
Examveda

What is the result of the following code snippet?

try {
int[] arr = new int[5];
int value = arr[2];
} catch (NullPointerException e) {
System.out.println("NullPointerException!");
} finally {
System.out.println("Finally Block!");
}

A. No output

B. NullPointerException!

C. Compilation error

D. Finally Block!

Answer: Option D


This Question Belongs to Java Program >> Exceptions

Join The Discussion

Related Questions on Exceptions