RuntimeException
is the superclass of those
exceptions that can be thrown during the normal operation of the
Java Virtual Machine.
RuntimeException
and its subclasses are unchecked
exceptions. Unchecked exceptions do not need to be
declared in a method or constructor's throws
clause if they
can be thrown by the execution of the method or constructor and
propagate outside the method or constructor boundary.
Modifier and Type | Field and Description |
---|---|
pack-priv static final long |
Access | Constructor and Description |
---|---|
public | |
public | RuntimeException(String
the detail message. The detail message is saved for
later retrieval by the message)getMessage() method.Constructs a new runtime exception with the specified detail message. |
public | RuntimeException(String
the detail message (which is saved for later retrieval
by the message, Throwable getMessage() method).the cause (which is saved for later retrieval by the
cause)getCause() method). (A null value is
permitted, and indicates that the cause is nonexistent or
unknown.)Constructs a new runtime exception with the specified detail message and cause. |
public | RuntimeException(Throwable
the cause (which is saved for later retrieval by the
cause)getCause() method). (A null value is
permitted, and indicates that the cause is nonexistent or
unknown.)Constructs a new runtime exception with the specified cause and a
detail message of |
protected | RuntimeException(String
the detail message. message, Throwable the cause. (A cause, boolean null value is permitted,
and indicates that the cause is nonexistent or unknown.)whether or not suppression is enabled
or disabled enableSuppression, boolean whether or not the stack trace should
be writable writableStackTrace)Constructs a new runtime exception with the specified detail message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled. |
serialVersionUID | back to summary |
---|---|
pack-priv static final long serialVersionUID Hides java. |
RuntimeException | back to summary |
---|---|
public RuntimeException() Constructs a new runtime exception with |
RuntimeException | back to summary |
---|---|
public RuntimeException(String message) Constructs a new runtime exception with the specified detail message.
The cause is not initialized, and may subsequently be initialized by a
call to
|
RuntimeException | back to summary |
---|---|
public RuntimeException(String message, Throwable cause) Constructs a new runtime exception with the specified detail message and cause. Note that the detail message associated with
|
RuntimeException | back to summary |
---|---|
public RuntimeException(Throwable cause) Constructs a new runtime exception with the specified cause and a
detail message of
|
RuntimeException | back to summary |
---|---|
protected RuntimeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) Constructs a new runtime exception with the specified detail message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled.
|