Further Notes on Exceptions

Credits for these notes

Exceptions

Problem: How can we elegantly deal with errors?

Answer: Use exceptions!

Exceptions

Example of throwing an exception

Catching an exception

What is an exception class?

Example of an exception class

Built-in Exceptions

The Exception Class Hierarchy

The Exception Hierarchy

Checked and Unchecked Exceptions

Unchecked Exceptions

Checked Exceptions

Catching Different Types Of Exception

Order of catching multiple exceptions

Getting information about an exception

finally