Before session 11
Exceptions
Objectives:
After completing the session, a student 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
- 11.1 Introduction
- 11.2 Throw exception
- 11.3 Catch exceptions
- 11.4 Exception class hierarchy, checked and unchecked exceptions
- 11.5 Keyword Finally
- 11.6 New exception classes
- 11.7. Useful tips
- 11.8 Tasks
Alternative materials
- in English: H. Schildt. Java - The Complete Reference: Chapter: 10
- in Estonian: here
- in Russian: Г. Шилдт. Java 8. Полное руководство: Chapter: 10