 | Chapter Summary (See related pages)
- Two techniques to improve program reliability are exception handling and assertion.
- Exception handling is another type of control flow.
- An exception represents an error condition, and when it occurs, we say an exception is thrown.
- Athrown exception must be handled by either catching it or propagating it to other methods.
- If the program does include code to handle the thrown exceptions, then the system will handle them.
- Asingle method can be both a catcher and a propagator of an exception.
- The standard classes described or used in this chapter are
| Throwable | | RuntimeException | | Error | | IllegalArgumentException | | Exception | | NumberFormatException | | IOException | | | | |
- The assertion feature is new to Java 2 SDK 1.4. You must use this version of
the compiler to use assertions in the program.
- The assertion feature is used to detect internal logic errors.
|
|