Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exceptions.Any help.  RSS feed

 
Siddhu
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Q)if an exception is not caught, the finally block will run and the rest of the method is skipped.
Is this true.
When the exception is not caught the finally block runs and again exception passes into the same method,.
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it's true. Because the exception has to be handled somewhere, and since it's not going to be in the method (it wasn't caught), then it has to propagate upwards (the exception) and control must leave the method in which the Exc was thrown and not caught (AFTER executing the finally if present, of course).
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!