Vidyalelo
Java Programming · Q22

Exceptions

Programming · Java Programming · question 22

Q22

What is the result of the following code snippet?try String str = "Java"; int num = Integer.parseInt(str); catch (NumberFormatException e) System.out.println("NumberFormatException!"); catch (Exception e) System.out.println("Exception!"); finally System.out.println("Finally Block!");

A.
Finally Block!
B.
NumberFormatException!
Finally Block!
Answer
C.
Compilation error
D.
Exception Block!

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board