# Java Level 5: Exceptions

> Level 5: Exceptions of the LoWisa Java course: Checked and Unchecked Exceptions, Error Propagation, Reliable Exception Design. 3 lessons and 9 ideas, each explained in one line.

Exceptions is level 5 of 16 of the [LoWisa Java course](/courses/java/). It has 3 lessons and 9 ideas. Below is every lesson and what it teaches, in one line each.

## Checked and Unchecked Exceptions

- **The two kinds.** Java splits exceptions: **checked** ones must be declared or handled, unchecked RuntimeExceptions may fly free.
- **throws.** The **throws** clause names the checked exceptions a method may raise: failure as part of the signature.
- **try/catch/finally.** A **try** block guards risky code, catch handles the named type, and finally runs no matter what.

## Error Propagation

- **Let it rise.** Most methods should **propagate**: catch only where you can genuinely handle, usually near the top.
- **Wrapping exceptions.** **Wrapping** a low-level exception in a domain one keeps the cause chained and the abstraction honest.
- **try-with-resources.** **try-with-resources** closes anything AutoCloseable automatically: files and connections that cannot leak.

## Reliable Exception Design

- **Messages that help.** An exception **message** names what was expected and what arrived: the 2am reader’s first clue.
- **Never swallow.** An empty catch block **swallows** the failure: the bug survives, the evidence dies.
- **Exceptions versus results.** Expected outcomes: not found, invalid input: often suit **Optional** or result objects better than exceptions.

## Before and after this level

- **Before:** [Level 4: Collections & Generics](/courses/java/level-4-collections-and-generics/): Lists, Sets and Maps, Generic Types, Choosing Appropriate Collections.
- **Next:** [Level 6: Functional Java](/courses/java/level-6-functional-java/): Lambdas, Streams, Functional Data Processing.

In the app each of these ideas is taught and then asked back, and the level ends with a checkpoint and flashcards. See [Checkpoints and flashcards](/help/checkpoints-and-flashcards/).

## Frequently asked questions

### What does Java Level 5: Exceptions cover?

Checked and Unchecked Exceptions, Error Propagation, Reliable Exception Design: 3 lessons and 9 ideas.

### What should I know before this level?

The level before it, Level 4: Collections & Generics, which covers Lists, Sets and Maps, Generic Types, Choosing Appropriate Collections.

## Learn Java on your phone

The first level is free. LoWisa is on Google Play and the App Store.

---

Source: https://lowisa.dev/courses/java/level-5-exceptions/ · Updated 2026-11-16
