We'll cover the purpose and use of exceptions following this order. The one sentence summary is “Exceptions are like software interrupts—they are generated by error conditions like division by zero, and they divert the flow of control to a place where you have said you will handle this kind of error.”
First, we'll look at the basics of:
Why exceptions are in the language.
What causes an exception (implicitly and explicitly).
Once an exception has occurred, you'll want to know how to take steps to deal with it:
How to handle (“catch”) an exception within the method where it was thrown.
Handling groups of related exceptions.
You'll also need to know what happens if you do not provide code to handle each type of exception. ...