JavaBeginner#exceptions

What is the exception hierarchy in Java?

Throwable is the root, splitting into Error (serious JVM-level issues like OutOfMemoryError, not meant to be caught) and Exception (recoverable conditions), which further splits into checked exceptions and RuntimeException (unchecked).

Example
try { throw new IllegalStateException("bad state"); }
catch (RuntimeException e) { System.out.println(e.getMessage()); }

Related Questions

1
JavaBeginner#exceptions

What is a custom exception and how do you create one?

Open
2
JavaIntermediate#exceptions

What is exception chaining (cause)?

Open
3
JavaBeginner#exceptions

What is the order of execution for try, catch, and finally?

Open