Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Objectives
In this appendix you’ll:
• Learn what exceptions are and how they’re handled.
• Understand when to use exception handling.
• Use try blocks to delimit code in which exceptions might occur.
• throw exceptions to indicate a problem.
• Use catch blocks to specify exception handlers.
• Use the finally block to release resources.
• Become familiar with the exception class hierarchy.
H.2 Example: Divide by Zero without Exception Handling
H.3 Example: Handling ArithmeticExceptions and InputMismatchExceptions
H.4 When to Use Exception Handling
H.7 Stack Unwinding and Obtaining Information from an Exception Object
Self-Review Exercises | Answers to Self-Review Exercises | Exercises