This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes What can be thrown Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "What can be thrown" Watch "What can be thrown" New topic

What can be thrown

manasa teja
Ranch Hand

Joined: May 27, 2002
Posts: 325
1 Error
2 Object
3 RunTimeException
4 Exception
5 Throwable

Answer given is 1,3,4,5.
Can we throw Error also. Please clarify.

Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
We can throw anything that is a subclass of Throwable and that includes Error, of course.

[Blog] [Blogroll] [My Reviews] My Linked In
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
The correct spelling is "RuntimeException" -- no capital T. Where did you find this question?

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
I agree. Here's the link:
subject: What can be thrown
It's not a secret anymore!