September 2011
Beginner
650 pages
15h 47m
English
Up to this point, we have been catching exceptions, but we haven’t been doing anything with the exception object itself. As the preceding examples all show, a catch clause specifies an exception type and a parameter. The parameter receives the exception object. Since all exceptions are subclasses of Throwable, all exceptions support the methods defined by Throwable. Several commonly used ones are shown in Table 9-1.

Table 9-1 Commonly Used Methods Defined by Throwable
Of the methods defined by Throwable, two of the most interesting are printStackTrace( ) and toString( ). You can display the standard error message ...
Read now
Unlock full access