Java's Error Classes

So far, you've had a look at the exception classes you can handle in your own programs. Java also defines a set of error classes that are really little more than special types of exceptions. These error classes are subclasses of Error, which, like Exception, is a subclass of Throwable.

Java's error classes represent serious errors, such as running out of memory or encountering an internal error in the virtual machine. Just as with unchecked exceptions, you are not required to handle the errors that might be thrown by a method. The rationale is quite different in this case however. Remember that unchecked exceptions should never occur in a correctly written program. Errors represented by the Error subclasses, however, might ...

Get Special Edition Using Java 2 Standard Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.