Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

checked/unchecked exception list

 
Asad Zubair
Ranch Hand
Posts: 44
Eclipse IDE Firefox Browser Java
  • Likes 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
  • 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
  • Likes 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
  • Likes 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic