Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

try catch block

 
Chris Cleverley
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Say there is a try block in which an exception is thrown. But the only exception that can be caught is one that is a parent of the exception that is actually thrown.
Will this exception be caught ?
Chris
 
KN
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Whenever you have a catch block which handles a particular exception, then all the exceptions which are the subclasses of that particular Exception are also caught with the same block.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic