Chapter 10
Exceptions
Objectives:
After completing the chapter, you can:
- get an overview of exceptions and exception handling;
- distinguish exception types: Error (fatal) vs. Exception (nonfatal);
- describe the classes
Exception
andThrowable
; - declare exceptions in a method header;
- improve programs adding try-catch blocks for catching and handling exceptions;
- use the
finally
clause in a try-catch block; - write own defined exception classes.
Topics
- 10.1 Introduction
- 10.2 Throw exception
- 10.3 Catch exceptions
- 10.4 Exception class hierarchy, checked and unchecked exceptions
- 10.5 Keyword Finally
- 10.6 New exception classes
- 10.7. Useful tips
- 10.8 Tasks
Alternative materials
- in English: H. Schildt. Java - The Complete Reference: Chapter: 10
- in Estonian: here
- in Russian: Г. Шилдт. Java 8. Полное руководство: Chapter: 10