File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes doubt in Exception 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 "doubt in Exception" Watch "doubt in Exception" New topic

doubt in Exception

Divya Gehlot
Ranch Hand

Joined: Sep 10, 2006
Posts: 243
I am really confused with checked and unchecked exceptions every time I read and get confused with that. Is there any simple way or trick to check checked and unchecked exceptions from exam point of view(SCJP1.5).
Thanks in Advance.

SCJP1.5(81%), SCDJWS(94%), next mission SCEA (but need to wait or that)
Sundaram Karthick

Joined: Jun 26, 2007
Posts: 24
Unchecked exceptions are subclasses of RuntimeException, and are usually implemented using IllegalArgumentException, NullPointerException, or IllegalStateException.
Checked are subclasses of Exception.
It is somewhat confusing, but note as well that RuntimeException (unchecked) is itself a subclass of Exception (checked).

SCJP 1.5, SCWCD 1.4, SCBCD 5
Divya Gehlot
Ranch Hand

Joined: Sep 10, 2006
Posts: 243
I am confused in that. Sometimes in questions they will ask whether it is Runtime Exception or ......
So so how to get overcome from all these . please suggest me some trick and tips.
Nik Arora
Ranch Hand

Joined: Apr 26, 2007
Posts: 652
Hi Divya,
Refer thisLink and if you have doubts post it here.

Scjp 1.5
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1710
Simple rules:

1- Checked exceptions: Compiler doesn't excuse you. You must handle
or declare the exception if your code is supposed to throw any checked
exception as, etc.
All checked exceptions extend from java.lang.Exception

Unchecked Exception: Where compiler doesn't bother regarding handle
or declare rule. All unchecked exception classes extend from

Isn't it simple?

Note: java.lang.RuntimeException also extend java.lang.Exception


chintan ramavat
Ranch Hand

Joined: Sep 15, 2006
Posts: 134
I think recalling the Exception Tree from

1 Error 2 Exception
- AssertionError ||
Runtime Compiletime
(unchecked) (checked)
| |
no need to need to play round
play around
I agree. Here's the link:
subject: doubt in Exception
It's not a secret anymore!