10. Exceptions
Chapter Contents
The Catch or Specify Requirement
Catching and Handling Exceptions
Specifying the Exceptions Thrown by a Method
The Java programming language uses exceptions to handle errors and other exceptional events. This chapter describes when and how to use exceptions. The first section defines an exception. An exception is an event that occurs during the execution of a program that disrupts the normal flow of instructions. The second section discusses the catch or specify requirement and describes the three kinds of exceptions. The third section covers how to catch and ...
Get The Java® Tutorial: A Short Course on the Basics, 6th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.