What is the difference between a Throwable and an Exception in Java?

Throwable is the root class of Java's exception-handling hierarchy. Both Exception and Error inherit from Throwable. Exception represents conditions that an application can potentially handle and recover from, whereas Error represents serious system-level problems that applications typically should not attempt to handle.

Diagram: Java exception class hierarchy
Java exception class hierarchy

Key Points

Exception vs Throwable

Throwable

Exception

Example

If a file is missing during execution, Java throws a FileNotFoundException, which is an Exception and can be handled. However, if the JVM runs out of memory, it throws an OutOfMemoryError, which is an Error and usually cannot be recovered from safely.

try {

    String str = null;
    System.out.println(str.length());

} catch (Exception e) {

    System.out.println("Exception handled");

}

Common Mistakes

Follow-up Questions

Interview Tip

A concise interview answer is

Throwable is the top-level class in Java's error-handling hierarchy. Exception is a subclass of Throwable used for recoverable conditions that applications can handle, while Error is another subclass that represents serious system-level problems that are generally not meant to be handled by application code.

Last updated: 11 November 2026

Previous question: How would you handle multiple exceptions in a single catch block?

Next question: Discuss the difference between finalize() and finally. Under what circumstances might finalize() not get called in a Java application?

More Core Java - Level II interview questions

All Core Java - Level II questions