If a method chooses not to catch an exception, the method must specify that it can throw that exception. Thus, in the method signature you specify the exceptions that the method can throw. The next page, Dealing with Exceptions , talks about specifying exceptions that a method throws and shows you how to do it. Of interest to us in this discussion are runtime exceptions. Runtime exceptions are those exceptions that occur within the Java runtime system.
Runtime exceptions can occur anywhere in a program and in a typical program can be very numerous.
The cost of checking for runtime exceptions often exceeds the benefit of catching or specifying them. Thus the compiler does not require that you catch or specify runtime exceptions, although you can. Some consider this a loophole in Java's exception handling mechanism, and programmers are tempted to make all exceptions runtime exceptions. In general, this is not recommended. The Controversy contains a thorough discussion about when and how to use runtime exceptions.