java.lang
Class IllegalArgumentException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IllegalArgumentException
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- IllegalThreadStateException, NumberFormatException
- public class IllegalArgumentException
- extends RuntimeException
Thrown when a method is passed an illegal or inappropriate argument. For
example:
wait(-1);
| Nested classes inherited from class java.lang.Throwable |
|
| Fields inherited from class java.lang.Throwable |
|
| Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
serialVersionUID
private static final long serialVersionUID
- Compatible with JDK 1.0+.
- See Also:
- Constant Field Values
IllegalArgumentException
public IllegalArgumentException()
- Create an exception without a message.
IllegalArgumentException
public IllegalArgumentException(String s)
- Create an exception with a message.
IllegalArgumentException
public IllegalArgumentException(String message,
Throwable cause)
Constructs a IllegalArgumentException using
the specified error message, which should give further details
as to the reason for this exception. The specified cause
Throwable may be used to provide additional history,
with regards to the root of the problem. It is perfectly valid
for this to be null, if the cause of the problem is unknown.
Note: the detail message from the cause is not
automatically incorporated into the resulting detail message of
this exception.
- Since:
- 1.5
IllegalArgumentException
public IllegalArgumentException(Throwable cause)
Constructs a IllegalArgumentException using
the specified cause Throwable, which may be used
to provide additional history, with regards to the root of the
problem. It is perfectly valid for this to be null, if the
cause of the problem is unknown.
The detail message is automatically constructed from the detail
message of the supplied causal exception. If the cause is null,
then the detail message will also be null. Otherwise, the detail
message of this exception will be that of the causal exception.
This makes this constructor very useful for simply wrapping another
exception.
- Since:
- 1.5