A

Admin • 833K Points
Coach

Q. 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) Exception Block!
  • Correct Answer - Option(B)
  • Views: 34
  • Filed under category Java
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.