IllegalArgumentException
The JDK's exception for an argument a method or constructor can't accept.
java.lang.IllegalArgumentException is thrown (throw new IllegalArgumentException(message)) to reject an unacceptable argument; uncaught, it ends the program with a stack trace.
Examples
if (amount <= 0) throw new IllegalArgumentException("amount must be positive: " + amount);
See also