Multiple choice technology programming languages

ZZZ (Duplicate) - Identify whether the following statement is true or false. The finally block is executed when an exception is thrown, even if no catch matches it.

  1. True

  2. False

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

The finally block is guaranteed to execute after the try and catch blocks, regardless of whether an exception is thrown or successfully caught. This ensures critical resources are always cleaned up even during unhandled exceptions, which makes the statement true.