Valid Java programming language code must honor the Catch or Specify Requirement. This means that code that might throw certain exceptions must be enclosed by either of the following:
-
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.
Code that fails to honor the Catch or Specify Requirement will not compile. …Not all exceptions are subject to the Catch or Specify Requirement.
[http://java.sun.com/docs/books/tutorial/ essential/exceptions/catchOrDeclare.html]