Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki MarkupWhen 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 blocks (JLS 205, Section 14.20.2, Execution of try-catch-finally|http://java.sun.com/docs/books/jls/third_edition/html/statements.html#14.20.2]\]).

Never use return, break, continue or throw statements within a finally block.

...