java.lang
public class AssertionError extends Error
assert
statement added in JDK 1.4, to indicate that an assertion failed. There
are enough constructors to ensure that
new AssertionError(expression)
will work for all
expressions, regardless of type, as if the error message were given by
the string "" + expression
. This extends Error,
because you usually do not want to inadvertently trap an assertion failure.Constructor and Description |
---|
AssertionError()
Construct an AssertionError with no detail message.
|
AssertionError(boolean msg)
Construct an AssertionError with the string conversion of the given
boolean as its error message.
|
AssertionError(char msg)
Construct an AssertionError with the string conversion of the given
char as its error message.
|
AssertionError(double msg)
Construct an AssertionError with the string conversion of the given
double as its error message.
|
AssertionError(float msg)
Construct an AssertionError with the string conversion of the given
float as its error message.
|
AssertionError(int msg)
Construct an AssertionError with the string conversion of the given
int as its error message.
|
AssertionError(long msg)
Construct an AssertionError with the string conversion of the given
long as its error message.
|
AssertionError(Object msg)
Construct an AssertionError with the string conversion of the given
object as its error message.
|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public AssertionError()
public AssertionError(Object msg)
msg
- the source of the error messageThrowable.getCause()
public AssertionError(boolean msg)
msg
- the source of the error messagepublic AssertionError(char msg)
msg
- the source of the error messagepublic AssertionError(int msg)
msg
- the source of the error messagepublic AssertionError(long msg)
msg
- the source of the error messagepublic AssertionError(float msg)
msg
- the source of the error messagepublic AssertionError(double msg)
msg
- the source of the error message