java.lang · java.base · since Java 1.0

Exception

declaration
public class Exception extends Throwable

The checked-exception root: subclasses (except RuntimeException's tree) must be declared and handled. Extend it for recoverable, caller-actionable failures.

  • Checked = part of the method contract, enforced by the compiler
  • Custom exceptions: carry context fields, provide (String, Throwable) constructors