# Custom Exception

say it: **“KUS-tum ek-SEP-shun”** **/ˈkʌstəm ɪkˈsɛpʃən/**

An application-specific exception type created by extending an exception class.

## What is **Custom Exception** in Java?

**Custom Exception** — An application-specific exception type created by extending an exception class.

```java
class InvalidSeatCountException extends RuntimeException {
    InvalidSeatCountException(String message) {
        super(message);
    }
}

class Reservation {
    void reserve(int seats) {
        if (seats < 1) {
            throw new InvalidSeatCountException("Seat count must be positive");
        }
    }
}
```

Level: Journeyman · [More Java terms at this level](https://www.ask-codey.com/glossary?category=java&level=3)

Updated: November 17, 2026

## In other subjects

- [Custom Exception in C#](https://www.ask-codey.com/glossary/custom-exception-c-sharp)
- [Custom Exception in Python](https://www.ask-codey.com/glossary/custom-exception)

Source: https://www.ask-codey.com/glossary/custom-exception-java
