Examveda
Examveda

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!

C. Compilation error

D. Finally Block!

Answer: Option B


This Question Belongs to Java Program >> Exceptions

Join The Discussion

Related Questions on Exceptions