Exceptions in Java

Presentation Sections

Section One

Lexicon: Actors and Actions

Lexicon: Types of Exceptions

Error Handling Before Exceptions

Problems with these Systems

Birth of Modern Exceptions

Goodenough’s Notation

Advantages of this Notation

Questions for Section One

Section Two

Classifying Java Exceptions

Keywords for Java Exceptions

General Syntax

Canonical Example

throw(s) Keyword

throw(s) Keyword, part 2

throw(s) Keyword, part 3

try Keyword

catch Keyword

catch Keyword, part 2

finally Keyword

finally Keyword, part 2

finally Keyword, part 3

Steps of try…catch…finally

Questions for Section Two

Section Three

Java Exception Hierarchy

Creating your own exception class

Three Critical Decisions

An Example of Return v. Raise

Mapping to an Exception Class

Using Unchecked Exceptions

Simple Type Subsumption

A Tricky Subsumption Problem

Avoiding Type Subsumption

Subsumption Is Good Too!

Type Encapsulation

Questions for Section Three

Section Four

The Utility of Backtracking

finally and finalize(), siblings?

Bytecode Layout

Bytecode Layout, part 2

Performance Issues

Exceptions and JIT Optimization

Bytecode to Machine Code

Why Runtime Exceptions are Not Checked

Issues in Multithreaded Code

Use a Callback Pattern

Use the ThreadGroup class

Exceptions and RMI

Questions for Section Four


Section One

Section Two

Section Three

Section Four