This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes throw Exception question 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 "throw Exception question" Watch "throw Exception question" New topic
Author

throw Exception question

Yan Bai
Ranch Hand

Joined: Jul 21, 2002
Posts: 125

Got compile error at line1:
Unreported Exception
Compare to this code:

compile ok.
Why?


SCJP 1.4
Alfred Kemety
Ranch Hand

Joined: Aug 14, 2002
Posts: 279
Compiler check only on Checked Exceptions and not non-checked exceptions Exception exception is a checked exception. All run-time exceptions - RuntimeException and all its subclasses - are non-checked exceptions, so the compiler doesn't check on them during compilation.
HTH


Alfred Raouf - Egypt - SCJP 1.4<br />Kemety.equals(Egyptian) // returns true
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: throw Exception question