The JavaTM Tutorial
Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search

Trail: Learning the Java Language
Lesson: The Nuts and Bolts of the Java Language

Exception Handling Statements

[PENDING: consider putting some real coverage in here]

When an error occurs within a Java method, the method can throw an exception to indicate to its caller that an error occurred and the type of error that occured. The calling method can use the try, catch, and finally statements to catch and handle the exception. See Handling Errors with Exceptions(in the Learning the Java Language trail) for information about throwing and handling exceptions.


Previous Page Lesson Contents Next Page Start of Tutorial > Start of Trail > Start of Lesson Search