A

Admin • 828.03K Points
Coach

Q. What will this code print?
try {
int x = 10 / 0;
} catch (ArithmeticException e) {
System.out.print("Catch");
} finally {
System.out.print("Finally");
}

  • (A) Catch
  • (B) Finally
  • (C) CatchFinally
  • (D) Exception

Explanation by: Admin
Both the catch and finally blocks execute and print: CatchFinally.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.