File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

checked/unchecked exception list

 
Asad Zubair
Ranch Hand
Posts: 44
Eclipse IDE Firefox Browser Java
  • 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Peter Mc Cormack
Greenhorn
Posts: 12
Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Asad, just what I was looking for!
 
Anayonkar Shivalkar
Bartender
Posts: 1557
5
Eclipse IDE Java Linux
  • 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic