🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: Java Exception Handling: all 10 questions

Quiz: Java Exception Handling · Question 9 of 10

When does a finally block NOT run?

When does a finally block NOT run?

  1. A.When the catch block throws a new exception
  2. B.When the try block has a return statement
  3. C.When no exception occurs
  4. D.When System.exit() is called inside try (or the JVM crashes)
Answer & explanation

Correct answer: When System.exit() is called inside try (or the JVM crashes)

finally runs in all normal cases, including return and exceptions, but System.exit stops the JVM immediately.

Can you get the rest right without peeking?

Take the timed Quiz: Java Exception Handling quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →