Monday, December 9, 2013

Exception in catch block or finally block

If the exception is thrown in catch block, it will go to finally block and then throws out the exception. Finally block cannot do anything on the exception as it does not have the exception reference, it can only do some clean up work, like close files, or db connections, then throws out the exception.

If the exception is thrown in finally block, it will throw out the exception.

No comments:

Post a Comment