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 Need help in Exceptions 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 "Need help in Exceptions" Watch "Need help in Exceptions" New topic

Need help in Exceptions

Saroja Eshwar

Joined: Oct 26, 2007
Posts: 10
Which are most typically thrown by an API developer or an application developer as opposed to being thrown by the JVM? (Choose all that apply.)
A). ClassCastException
B). IllegalStateException
C). NumberFormatException
D). IllegalArgumentException
E). ExceptionInInitializerError

How to know whether the Exception is thrown by API developer or JVM
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 41180
Please QuoteYourSources.

Ping & DNS - my free Android networking tools app
Anders Hermansen

Joined: Nov 15, 2007
Posts: 6
I just asked a question almost about the same object.

There i asked if it is right to think of a JVM thrown exception as a RunTimeException and a programatically thrown exception as a checked exception.

If it is, then the correct answer is B and D.

And not C even though K & B in their book on SCJP states that NumberFormatException is typically thrown programatically. The JAVA API states that NumberFormatException is a RuntimeException.
Don't get me started about those stupid light bulbs.
subject: Need help in Exceptions
Similar Threads
Exceptions thrown programatically or by JVM?
RunTimeException or checked Exception?
SCJP question.
Exception ..
Exception: Programmtically or by JVM?