This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Should I know the runtime exceptions for the exam? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Should I know the runtime exceptions for the exam?" Watch "Should I know the runtime exceptions for the exam?" New topic
Author

Should I know the runtime exceptions for the exam?

Marc Wentink
Ranch Hand

Joined: May 18, 2007
Posts: 142
One of the topics of the exam is to be able to see the difference between code involving checked and unchecked or runtime exceptions. But should I actually know what are the RuntimeExceptions, when they are thrown in a program? From the list below I only know NullPointerException. And other Exceptions like IOExceptions I thought would be runtime errors, but appearantly are not.

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/RuntimeException.html


SCJP5
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Yeah you need to know what are programmatically and JVM thrown exceptions.
You will have to recognized what exception the given code may throw. List of
Exceptions covered in the exam objective can be found Page 370 of K&B.



Thanks,


cmbhatt
Marc Wentink
Ranch Hand

Joined: May 18, 2007
Posts: 142
Thanks. Another question about this topic. It seems logical that JVM thrown exceptions are always unchecked RTE, but I cannot seem to put my finger on a text that actually confirms that. It is true though, JVM throwns are pro def unchecked?
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707

It seems logical that JVM thrown exceptions are always unchecked RTE, but I cannot seem to put my finger on a text that actually confirms that. It is true though, JVM throwns are pro def unchecked?


RuntimeException is a class that extends Exception. Any exception that
inherits from the RuntimeException is unchecked exception. If your confusion
is there is something called compile time exception, that is wrong. Stick
to the fact that RuntimeException is a class and this as well any subclasses
of this throw unchecked exception.

Unchecked exception just means you don't need to handle or declare that exception where as checked exceptions must be caught or declared otherwise
compiler error.


Thanks,
[ May 30, 2007: Message edited by: Chandra Bhatt ]
Matt Russell
Ranch Hand

Joined: Aug 15, 2006
Posts: 165
Originally posted by Marc Wentink:
Thanks. Another question about this topic. It seems logical that JVM thrown exceptions are always unchecked RTE, but I cannot seem to put my finger on a text that actually confirms that. It is true though, JVM throwns are pro def unchecked?


Yeah, as you say, they pretty much have to be unchecked, otherwise programming in Java would be unbearably annoying! See:

http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.6
[ May 30, 2007: Message edited by: Matt Russell ]

Matt
Inquisition: open-source mock exam simulator for SCJP and SCWCD
Marc Wentink
Ranch Hand

Joined: May 18, 2007
Posts: 142
Thank you very much for the information.
Sergio Tridente
Ranch Hand

Joined: Mar 22, 2007
Posts: 329

These are the exceptions mentioned in the exam's objectives:


Recognize situations that will result in any of the following being thrown: ArrayIndexOutOfBoundsException,ClassCastException, IllegalArgumentException, IllegalStateException, NullPointerException, NumberFormatException, AssertionError, ExceptionInInitializerError, StackOverflowError or NoClassDefFoundError. Understand which of these are thrown by the virtual machine and recognize situations in which others should be thrown programatically.


SCJP 1.4 (88%) - SCJP 5.0 Upgrade (93%) - SCWCD 1.4 (97%) - SCBCD 5.0 (98%)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Should I know the runtime exceptions for the exam?
 
Similar Threads
own unchecked exception...?
How to throw exception in run method
true or false?
Method overriding
doubt: Guessing Exceptions