When program execution enters a try
block that has a finally
block, the finally
block always executes, regardless of whether the try
block (or any associated catch
blocks) execute to completion. Statements that cause the finally
block to terminate abruptly also cause the try
block to terminate abruptly, and consequently mask any exception thrown from the try
or catch
blocks (JLS 205, Section 14.20.2, Execution of try-catch-finally2005).
Never use return
, break
, continue
or throw
statements within a finally
block.
...