wood burning stoves*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Checked Exceptions and  Unchecked Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Checked Exceptions and  Unchecked" Watch "Checked Exceptions and  Unchecked" New topic
Author

Checked Exceptions and Unchecked

Binu K Idicula
Ranch Hand

Joined: Jul 11, 2002
Posts: 99
Runtime exceptions are unchecked and so does that means a method which throws a runtime exception need not be called from within a try catch block or which throws exception type??
Will there be specific questions asking which are checked and unchecked exceptions ??
IF so which exceptions are to be studied ?
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
Runtime exceptions are unchecked and so does that means a method which throws a runtime exception need not be called from within a try catch block or which throws exception type??
Yes
Will there be specific questions asking which are checked and unchecked exceptions ??
In the new 1.4 exam, the objectives concerning exceptions are:
- Write code that makes proper use of exceptions and exception handling clauses (try, catch, finally) and declares methods and overriding methods that throw exceptions.
- Recognize the effect of an exception arising at a specified point in a code fragment. Note: The exception may be a runtime exception, a checked exception, or an error (the code may include try, catch, or finally clauses in any legitimate combination).
IF so which exceptions are to be studied ?
You should at least know the most common checked and unchecked exception (ArithmeticException, ClassCastException and the like). Some questions may ask whether some code results in an exception being thrown at runtime (the very effect of unchecked exception) or not. You should be able to recognize that an incorrect cast will result in an exception (ClassCastException) at runtime.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[Blog] [Blogroll] [My Reviews] My Linked In
Binu K Idicula
Ranch Hand

Joined: Jul 11, 2002
Posts: 99
Thank you ...for the detailed reply
Kumar Kausikasa
Ranch Hand

Joined: Jun 04, 2002
Posts: 45
Hi Valentin,
I have a question regarding the exception.IT sayd in RHE book, page no:145, that all the sublcass of java.lang.Exception are checked exception except java.lag.RuntimeException
. But all under the hierarchy of java.lang.Throwable.
What are the ways to recognize which are checked exception and which are not?
a) Do i need to memorize them which are under RuntimeException?
b)As you stated RuntimeException do not require try and catch , is that can be a criteria?
Can you tell me some ways of figuring it out in the code?
Thanks for your time
Praveen
Binu K Idicula
Ranch Hand

Joined: Jul 11, 2002
Posts: 99
Hi ,
It seems easy to remember some RuntimeExceptions ..Only a few exceptions listed in the java api are extending RuntimeException ..
say important among these are ...ArithmeticException, ArrayStoreException,ClassCastException, EmptyStackException, IllegalArgumentException, IllegalMonitorStateException,NullPointerException,IndexOutOfBoundsException. I hope it is easy to remember these names ,...
regards
Binu K Idicula
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Checked Exceptions and Unchecked