# Custom Exception

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/subjects/java/journeyman)

Updated: September 27, 2026

## In other subjects

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

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