In exception handling, what will happen if catch block or finally block having Exception?
2 Answers
Finally block exception will mask the original exception.
When an new exception is thrown in a catch block or finally block that will propagate out of that block, then the current exception will be aborted (and forgotten) as the new exception is propagates outward.

- 31,165
- 11
- 75
- 105
-
-
-
http://www.youtube.com/durgaeducation , Here you can find all cases in exception handling – Butchi Reddy Velagala Feb 13 '14 at 09:40
As per the JLS 14.20.2. Execution of try-finally and try-catch-finally
If the catch block completes abruptly for reason R, then the finally block is executed. Then there is a choice:
If the finally block completes normally, then the try statement completes abruptly for reason R.
If the finally block completes abruptly for reason S, then the try statement completes abruptly for reason S (and reason R is discarded).
A finally block may throw an exception and if so, any exception thrown by the try or catch block is lost.
Ref: http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.20.2

- 11,851
- 21
- 73
- 98