Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

exceptions

 
anita dhar
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is checked and unchecked exception example for checked and unchecked
 
dave zebatinsky
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aneea,

Checked exceptions that have a direct superclass of Exception are those that need to be listed in a method's throws clause, whereas unchecked exceptions that have a superclass of RuntimeException do not need to be listed as they can be thrown from almost any method.

a checked exception can be IOException for example, and an unchecked exception can be illegalStateException for example.

Cheers,

Dave
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Moving...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic