I see that the Finally
in Try .. Catch
will always execute after any parts of the execution of the try catch block.
Is it any different to
Finally contains code that needs to be evaluated at all conditions [whether or not an exception occurred].
There is no way to exit a try block without executing its finally block. If the finally block exists, it always executes. (This statement is true for all intents and purposes. There is a way to exit a try block without executing the finally block. If the code executes a System.exit(0); from within a try block, the application terminates without the finally executing. On the other hand, if you unplug the machine during a try block, the finally will not execute either.)
The main use is for disposing objects. It will be useful when you want to close user defined resources like file , opened resources(db stmts).
Edit
Also finally won't be executed after a stackoverflow exception.