When I have two exceptions thrown in the same try block, when the first exeption is thrown, the second exception is ignored. Why?
The concepts you really need to understand are: An exception is thrown, which means the code cannot continue its normal path. The later code will not be excuted no mater there is another throw exception statement or not. This bad situation will continue until the thrown exception is caught or the program will die at the top level.
Related Questions
- What happens if a try-catch-finally statement does not have a catch clause to handle an exception that is thrown within the body of the try statement?
- When I have two exceptions thrown in the same try block, when the first exeption is thrown, the second exception is ignored. Why?
- Does adding exception handling (try/catch block) affect a programs performance?