Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exceptions : Help Needed

 
Sandeep Vaid
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,

Please let me know if there is a rule which specifies whether an exception is unchecked or checked by just looking @ exception name? In other words how you came to know that NullPointerException is a unchecked exception and IOException is a checked exception.?
 
Andrea Z�rcher
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NullPointerException is a subclass from RuntimeException. All subclasses from RuntimeException are unchecked exceptions. IOException is a direct subtype from java.lang.Exception. So it's a checked exception.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic