The SCJP5 book from Kathy Sierra/Bert Bates states the following (under Chapter 5, Handling Exceptions topic): A finally block encloses code that is always executed at some point after the try block, whether an exception was thrown or not. Even if there is a return statement in the try block, the finally block executes right after the return statement is encountered, and before the return executes!
I tested the above statement with following example:
inside try--before exception inside try--after exception Hello World inside finally
Even though the book says "finally block executes right after the return statement is encountered, and before the return executes!", the ouput of above code doesn't match the book statement. In other words, the return statement in above code is executing first and then the finally block is being called.