aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Catching or declaring exception doubt. 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 "Catching or declaring exception doubt." Watch "Catching or declaring exception doubt." New topic
Author

Catching or declaring exception doubt.

Rahul Choudhary
Greenhorn

Joined: Jul 25, 2012
Posts: 22


When I try compiling it gives error saying "unreported exception, must be caught or declared to be thrown".

Isn't this line declaring the exception so why the error?


If I'm missing out any statement please highlight it. Thanks.
Jelle Klap
Bartender

Joined: Mar 10, 2008
Posts: 1822
    
    7

If the catch-or-specify requirement applies to the raise() method, why wouldn't it also apply to the main() method?


Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
Rahul Choudhary
Greenhorn

Joined: Jul 25, 2012
Posts: 22
Just compiled and checked works! Thanks Jelle
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Catching or declaring exception doubt.