0Pricing
Java Academy · Lesson

Throwing & Custom Exceptions

Learn to throw exceptions explicitly and define custom exception classes.

Intro

Sometimes you need to signal an error yourself. Java lets you throw exceptions explicitly and even create custom types.

Throw keyword

The throw statement creates and sends an exception. Use it inside methods to indicate something went wrong.

All lessons in this course

  1. Throwing & Custom Exceptions
  2. try-with-resources (AutoCloseable)
  3. Defensive Programming
← Back to Java Academy