Q. 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!
πŸ’¬ Discuss
βœ… Correct Answer: (D) Finally Block!

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
125
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Kiran Rapria
Publisher
πŸ“ˆ
82%
Success Rate