Java Exception Reference

Browse checked and unchecked Java exceptions with class hierarchy and causes.

A searchable reference of Java's standard-library Throwable hierarchy — checked exceptions, unchecked RuntimeExceptions, and Errors, each with its parent class and typical cause. Filter by kind, runs in your browser.

What is the difference between checked and unchecked exceptions in Java?

Checked exceptions are subclasses of Exception (excluding RuntimeException) and must be declared with throws or handled with try/catch. Unchecked exceptions extend RuntimeException and the compiler does not force you to handle them; they usually indicate programming bugs.

This is a searchable reference for Java’s Throwable hierarchy — the standard-library tree of checked exceptions, unchecked RuntimeExceptions, and Errors. For each class it shows the direct parent, whether it is checked or unchecked, and the typical cause, so you can decide what to catch and what to let propagate.

How it works

Everything throwable in Java descends from java.lang.Throwable. It splits into two branches. Error and its subclasses (OutOfMemoryError, StackOverflowError) represent serious JVM-level failures an application should not try to recover from. Exception covers recoverable conditions; within it, anything extending RuntimeException is unchecked (the compiler does not force handling), while every other Exception subclass is checked and must be declared with throws or wrapped in try/catch.

The kind filter lets you list just checked exceptions, just unchecked ones, or just Errors. The Extends column lets you trace each class up its inheritance chain — useful when deciding whether a broad catch (IOException e) will also catch a more specific FileNotFoundException (it will, because the latter is a subclass).

Example

A method that declares its checked exception and a caller that handles a whole family:

void load(Path p) throws IOException {     // checked: must declare
    Files.readAllBytes(p);                 // may throw NoSuchFileException
}

try {
    load(path);
    int n = Integer.parseInt(input);       // may throw NumberFormatException (unchecked)
} catch (IOException e) {                   // catches FileNotFoundException too
    log.warn("io failed", e);
} catch (NumberFormatException e) {         // unchecked, optional to catch
    n = 0;
}

Because NumberFormatException is unchecked, the compiler would not complain if you omitted that catch — but doing so lets bad input crash the call. Everything runs in your browser; nothing is uploaded.