This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What happens to the uncaught exceptions in finally block?  RSS feed

 
Tejas Jain
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Will JVM ignore them?
 
Andrey Kozhanov
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 53750
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's all in the Java™ Language specification, but the answers you got here are easier to understand
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!