aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes checked/unchecked exception list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "checked/unchecked exception list" Watch "checked/unchecked exception list" New topic
Author

checked/unchecked exception list

Asad Zubair
Ranch Hand

Joined: May 08, 2011
Posts: 44

Hi folks,

There is list of exceptions in the KB book that classifes them as thrown by JVM or programmer. However, I could not find a proper list in the book or the forums that classifies them by checked vs unchecked. So I have a compiled a list here of the ones I have encountered in the book and mock exams for you guys to use as a resource. (Enjoy).
If there is any that you have encountered, feel free to add to this list but please limit your responses to your findings in mock exams/KB book only.

Unchecked
ArrayIndexOutOfBoundsException
ClassCastException
IllegalArgumentException
IllegalStateException
NullPointerException
NumberFormatException
AssertionError
ExceptionInInitializerError
StackOverflowError
NoClassDefFoundError

Checked
Exception
IOException
FileNotFoundException
ParseException
ClassNotFoundException
CloneNotSupportedException
InstantiationException
InterruptedException
NoSuchMethodException
NoSuchFieldException


OCPJP6
Peter Mc Cormack
Greenhorn

Joined: Oct 05, 2012
Posts: 12

Thanks Asad, just what I was looking for!
Anayonkar Shivalkar
Bartender

Joined: Dec 08, 2010
Posts: 1505
    
    5

I remember a simple rule:

if e IS-A RuntimeException, or e IS-A Error, then it is unchecked exception;
otherwise, it is checked exception.

Correct me if I'm wrong.


Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Anayonkar Shivalkar wrote:Correct me if I'm wrong.

You are right.
From JLS:

The unchecked exceptions classes are the class RuntimeException and its subclasses, and the class Error and its subclasses.
All other exception classes are checked exception classes
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: checked/unchecked exception list