Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checked and Unchecked exceptions

 
subash chandar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the difference between checked and unchecked exception.

How to identify whether an exception is checked or unchecked.
Is RunTimeException checked or unchecked
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Checked exceptions are have to be handled at compile time, unchecked exceptions need to be handled at runtime. Checked exceptions subclass java.lang.Exception, unchecked exceptions subclass java.lang.RuntimeException. Here this can be a little confusing, since RuntimeException also extends Exception. The thinking is that unchecked exceptions are supposed to be more trivial (though this is not necessarily how it works in practice).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic