Multiple choice technology programming languages

Consider the following case: A return statement is there in the catch block. An exception occurs and is caught. Now will the finally block be executed?

  1. will execute

  2. will not execute

  3. Compilation Error

  4. Runtime Exception

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

In Java, the finally block is guaranteed to execute even if there is a return statement in the try or catch block, ensuring clean-up code is always run.