This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Checked and Unchecked Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Checked and Unchecked Exception" Watch "Checked and Unchecked Exception" New topic
Author

Checked and Unchecked Exception

nitin sethi
Ranch Hand

Joined: Jul 14, 2011
Posts: 59

Could anyone confirm if the below is the exact classification for checked and unchecked exception?


1. Throwable (checked)
1.1 Error (unchecked)
1.1.1 unchecked hierarchy
1.2 Exception (checked)
1.2.1 checked hierarchy
1.2.2 RuntimeException (unchecked)
1.2.2.1 unchecked hierarchy
naveen yadav
Ranch Hand

Joined: Oct 23, 2011
Posts: 384

Yes your classification is correct.
In other words

Unchecked Exception = (Error and its subclass Exception + Runtime and its subclass Exception ).

Checked Exception = (Throwable Exception - Unchecked Exception).






Javin Paul
Ranch Hand

Joined: Oct 15, 2010
Posts: 281

In simple words, Any Exception which is sub-class or inherited from RuntimeException is unchecked Exception and doesn't require to be declared on throws clause. rest are checked exceptions.


http://javarevisited.blogspot.com - java classpath - Java67 - java hashmap - java logging tips java interview questions Java Enum Tutorial
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Checked and Unchecked Exception
 
Similar Threads
Exceptions
Why this exception handling works?
exceptions
Exception Doubt
NumberFormatException