This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in Exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in Exceptions" Watch "Doubt in Exceptions" New topic
Author

Doubt in Exceptions

Lavanya Raguram
Greenhorn

Joined: Apr 03, 2006
Posts: 27
I was going thro Exception Handling in K&B book, where they have mentioned that checked exceptions should be either declared or handled but it is not necessary for runtime or error type of exceptions.

But i am not able to classify which r checked n which r unchecked exceptions can anyone pls post the exceptions with their classifications as checked n unchecked or is their any other means to find out if the exception is chekced or not.I am completely confused regding this.
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
RuntimeException, Error, and their subclasses are unchecked. All other exceptions are checked.
Lavanya Raguram
Greenhorn

Joined: Apr 03, 2006
Posts: 27
i know that runtime,error are unchecked but i dono the names of the exceptions that r checked n unchecked how can i find which exceptions r runtime exceptions or exceptions of type error or they r checked exceptions.

is there any book that specifically lists out the cchecked n unchecked exceptions?
Keith Lynn
Ranch Hand

Joined: Feb 07, 2005
Posts: 2367
I don't know if there is an exhaustive list. However, you can you use the API docs and find them.
Naresh Gunda
Ranch Hand

Joined: Oct 15, 2005
Posts: 163
RuntimeException, Error, and their subclasses are unchecked. All other exceptions are checked.

check Java API

For every class, its super class is given in the API

Suppose for ArithmeticException,



Here ArithmeticException is the subclass of RuntimeException so it is unchecked exception.
[ April 05, 2006: Message edited by: Naresh Kumar ]
 
jQuery in Action, 2nd edition
 
subject: Doubt in Exceptions
 
Similar Threads
empty try block
what r checked and unchecked exceptions
try-catch compile problems
Checked and uncheked exceptions
Exceptions