Keywords: current

Next: 1.11.1 A Motivating Example Up: 1. From C++ to Previous: 1.10.4 Polymorphic Visitors with

# 1.11 Unusual Situations versus Runtime Errors

In this section, we study Java exceptions, a language construct to process unusual situations and run-time errors. In the process, we will identify the limitations of checked exceptions.

Many production programs have to detect erroneous input, report it to the user, and in some cases recover to handle more input. Since handling erroneous input deviates from the expected flow of program control, Java provides a mechanism called exception handling that is tailored for this purpose. To be more specific, let us consider an example based on the arithmetic expression evaluator from the previous section.

Subsections

- 1.11.1 A Motivating Example
- 1.11.2 Using Java Exceptions
- 1.11.3 Exception Handling