File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes exceptions:catch or specify requirement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "exceptions:catch or specify requirement" Watch "exceptions:catch or specify requirement" New topic
Author

exceptions:catch or specify requirement

Rajiv Chelsea
Ranch Hand

Joined: Jun 15, 2010
Posts: 88
Quoting from Sun doc

"Code that fails to honor the Catch or Specify Requirement will not compile. "

Please help me with some code examples illustrating the same..
Sridhar Santhanakrishnan
Ranch Hand

Joined: Mar 20, 2007
Posts: 317


check this link
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Sridhar Santhanakrishnan wrote:

check this link

...which, ironically, is where the original poster seems to be quoting from.

Rajiv, have you tried to write your own examples based on what that article tells you?


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Hint:

- A try statement that catches the exception. The try must provide a handler for the exception, as described in Catching and Handling Exceptions.
- A method that specifies that it can throw the exception. The method must provide a throws clause that lists the exception, as described in Specifying the Exceptions Thrown by a Method.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: exceptions:catch or specify requirement