1
JavaIntermediate#exceptions
A user-defined exception class extending Exception (checked) or RuntimeException (unchecked), used to represent domain-specific error conditions with more meaningful names and data.
class InsufficientFundsException extends RuntimeException {
InsufficientFundsException(String msg) { super(msg); }
}
throw new InsufficientFundsException("Balance too low");