Multiple choice technology business process management

The statement enclosed with in a finally block will be executed

  1. when no exception occurs

  2. when exception occurs

  3. Based on the exception

  4. Never

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

The finally block in Java is designed to execute code regardless of whether an exception is thrown or caught, ensuring cleanup operations run. It does not depend on the exception type and is not skipped.