Possible Duplicate:
throws Exception in finally blocks
The catch block is only executed if an exception is thrown in the try block.
The finally block is executed always after the try(-catch) block, if an exception is thrown or not.
My question is IF I got Exception in finally block than how to handle it ?????
This is a well-known problem/gotcha in the Java language specification, in the sense that if an exception is thrown within the finally clause (without handling it in a nested try-catch) , the original exception gets lost. You will need to nest a new try-catch to catch the new exception, and process it there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With