THE Java programming language uses exceptions to handle errors and other exceptional events. This chapter describes when and how to use exceptions.
The term exception is shorthand for the phrase “exceptional event.”
An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program’s instructions.
When an error occurs within a method, the method creates an object and hands it off to the runtime system. The object, called an exception object, contains information about the error, including its type and the state of the program when the error occurred. Creating an exception object and handing it to the runtime system is called throwing an exception ...