public class Exception extends Throwable
Exception is the superclass of all classes that represent recoverable
exceptions. When exceptions are thrown, they may be caught by application
code.Throwable,
Error,
RuntimeException,
Serialized Form| Modifier | Constructor and Description |
|---|---|
|
Exception()
Constructs a new
Exception that includes the current stack trace. |
|
Exception(String detailMessage)
Constructs a new
Exception with the current stack trace and the
specified detail message. |
|
Exception(String detailMessage,
Throwable throwable)
Constructs a new
Exception with the current stack trace, the
specified detail message and the specified cause. |
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.
|
|
Exception(Throwable throwable)
Constructs a new
Exception with the current stack trace and the
specified cause. |
| Modifier and Type | Method and Description |
|---|---|
Class[] |
getClassContext() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic Exception()
Exception that includes the current stack trace.public Exception(String detailMessage)
Exception with the current stack trace and the
specified detail message.detailMessage - the detail message for this exception.public Exception(String detailMessage, Throwable throwable)
Exception with the current stack trace, the
specified detail message and the specified cause.detailMessage - the detail message for this exception.throwable - the cause of this exception.public Exception(Throwable throwable)
Exception with the current stack trace and the
specified cause.throwable - the cause of this exception.protected Exception(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
message - the detail message.cause - the cause. (A null value is permitted,
and indicates that the cause is nonexistent or unknown.)enableSuppression - whether or not suppression is enabled
or disabledwritableStackTrace - whether or not the stack trace should
be writablepublic Class[] getClassContext()
Copyright © 2007–2016 The Apache Software Foundation. All rights reserved.