Exception
and its subclasses are a form of
Throwable
that indicates conditions that a reasonable
application might want to catch.
The class Exception
and any subclasses that are not also
subclasses of RuntimeException
are checked
exceptions. Checked exceptions 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.
java.lang.Error
Modifier and Type | Field and Description |
---|---|
pack-priv static final long |
Access | Constructor and Description |
---|---|
public | |
public | Exception(String
the detail message. The detail message is saved for
later retrieval by the message)getMessage() method.Constructs a new exception with the specified detail message. |
public | Exception(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 exception with the specified detail message and cause. |
public | Exception(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 exception with the specified cause and a detail
message of |
protected | Exception(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 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. |
Exception | back to summary |
---|---|
public Exception() Constructs a new exception with |
Exception | back to summary |
---|---|
public Exception(String message) Constructs a new exception with the specified detail message. The
cause is not initialized, and may subsequently be initialized by
a call to
|
Exception | back to summary |
---|---|
public Exception(String message, Throwable cause) Constructs a new exception with the specified detail message and cause. Note that the detail message associated with
|
Exception | back to summary |
---|---|
public Exception(Throwable cause) Constructs a new exception with the specified cause and a detail
message of
|
Exception | back to summary |
---|---|
protected Exception(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) Constructs a new exception with the specified detail message, cause, suppression enabled or disabled, and writable stack trace enabled or disabled.
|