Multiple choice technology web technology

if you write return as the last statement in the try block and no exception occurs, the finally block will execute.

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The finally block always executes when the try block exits, regardless of how it exits - whether through normal execution, an exception, or a return statement. The only exceptions are if the JVM exits (via System.exit()) or the thread dies. Even when return is the last statement in try, finally runs before the method actually returns.