Exception

An object describing a problem that interrupts normal program flow.

What is Exception in Java?

Exception — An object describing a problem that interrupts normal program flow.

class Reservation {
    void reserve(int seats) {
        if (seats < 1) {
            throw new IllegalArgumentException("seats");
        }
    }
}

Level: Journeyman · More Java terms at this level

Updated

In other subjects