aspose file tools*
The moose likes Java in General and the fly likes What happens to the uncaught exceptions in finally block? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "What happens to the uncaught exceptions in finally block?" Watch "What happens to the uncaught exceptions in finally block?" New topic
Author

What happens to the uncaught exceptions in finally block?

Tejas Jain
Ranch Hand

Joined: Mar 04, 2008
Posts: 119
Will JVM ignore them?


"Knowing is not enough, you must apply... Willing is not enough, you must do."
--Bruce Lee
Andrey Kozhanov
Ranch Hand

Joined: Mar 12, 2010
Posts: 79
No, they will be thrown after finally block execution. Unless there is return statement in finally block - in this case uncaught exceptions will be ignored.
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3010
    
  10
Unless there is a return statement in the finally block - or unless a new exception is thrown from the finally block. Both cases result in the original exception being forgotten without a trace.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38389
    
  23
It's all in the Java™ Language specification, but the answers you got here are easier to understand
 
wood burning stoves
 
subject: What happens to the uncaught exceptions in finally block?