aspose file tools*
The moose likes Java in General and the fly likes How to classify an exception as checked or unchecked? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to classify an exception as checked or unchecked?" Watch "How to classify an exception as checked or unchecked?" New topic
Author

How to classify an exception as checked or unchecked?

Ajay Xavier
Ranch Hand

Joined: Jan 03, 2005
Posts: 109
Hi,

Thanks for every one who gave their veiws on my last query.(Throwing a null value from a method)

How to classify an exception as a checked one or unchecked one? To be more precise how do i decide the superclass (Exception or RuntimeException) of my custom exception?

Thanks,
Ajay.
Chetan Raju
Ranch Hand

Joined: Aug 02, 2006
Posts: 109
All exception classes that extend the RuntimeException class are said to be unchecked exceptions. This means the compiler doesn't check the RuntimeExceptions. So if you want to create a checked exception then extend your class with Exception class.

Also, the Error class and subclasses of Error are also unchecked by compiler.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to classify an exception as checked or unchecked?