O'Reilly logo

PURE Java™ 2 by Kenneth Litwak

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The Throwable Class

Java has a class called Throwable, from which two major classes, Error and Exception, inherit. Figure 10.1 shows the class hierarchy.

Figure 10.1. Class hierarchy for Error and Exception.

A Java developer normally doesn't do anything with Throwable, so I'll not consider this class. You have to have a class that is a subclass of Throwable, however, to throw an error or exception. All Throwable objects contain information on the execution stack for the executing Thread at the time the error or exception object was created. You also won't write any code to deal with Error or any subclasses of it. An Error stems from events like ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required