aspose file tools*
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
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
 
Similar Threads
Queston on exceptions
exception
The strange ways of compile time constants
Can I add exceptions to an interface?
own unchecked exception...?