java.lang
Class AssertionError

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.lang.Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable 
      extended by java.lang.Error sample code for java.lang.Error definition code for java.lang.Error 
          extended by java.lang.AssertionError
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class AssertionError
extends Error sample code for java.lang.Error definition code for java.lang.Error

Thrown to indicate that an assertion has failed.

The seven one-argument public constructors provided by this class ensure that the assertion error returned by the invocation:

     new AssertionError(expression)
 
has as its detail message the string conversion of expression (as defined in The Java Language Specification, Second Edition, Section 15.18.1.1), regardless of the type of expression.

Since:
JDK1.4
See Also:
Serialized Form

Constructor Summary
AssertionError sample code for java.lang.AssertionError.AssertionError() definition code for java.lang.AssertionError.AssertionError() ()
          Constructs an AssertionError with no detail message.
AssertionError sample code for java.lang.AssertionError.AssertionError(boolean) definition code for java.lang.AssertionError.AssertionError(boolean) (boolean detailMessage)
          Constructs an AssertionError with its detail message derived from the specified boolean, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.
AssertionError sample code for java.lang.AssertionError.AssertionError(char) definition code for java.lang.AssertionError.AssertionError(char) (char detailMessage)
          Constructs an AssertionError with its detail message derived from the specified char, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.
AssertionError sample code for java.lang.AssertionError.AssertionError(double) definition code for java.lang.AssertionError.AssertionError(double) (double detailMessage)
          Constructs an AssertionError with its detail message derived from the specified double, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.
AssertionError sample code for java.lang.AssertionError.AssertionError(float) definition code for java.lang.AssertionError.AssertionError(float) (float detailMessage)
          Constructs an AssertionError with its detail message derived from the specified float, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.
AssertionError sample code for java.lang.AssertionError.AssertionError(int) definition code for java.lang.AssertionError.AssertionError(int) (int detailMessage)
          Constructs an AssertionError with its detail message derived from the specified int, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.
AssertionError sample code for java.lang.AssertionError.AssertionError(long) definition code for java.lang.AssertionError.AssertionError(long) (long detailMessage)
          Constructs an AssertionError with its detail message derived from the specified long, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.
AssertionError sample code for java.lang.AssertionError.AssertionError(java.lang.Object) definition code for java.lang.AssertionError.AssertionError(java.lang.Object) (Object sample code for java.lang.Object definition code for java.lang.Object  detailMessage)
          Constructs an AssertionError with its detail message derived from the specified object, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.
 
Method Summary
 
Methods inherited from class java.lang.Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable
fillInStackTrace sample code for java.lang.Throwable.fillInStackTrace() definition code for java.lang.Throwable.fillInStackTrace() , getCause sample code for java.lang.Throwable.getCause() definition code for java.lang.Throwable.getCause() , getLocalizedMessage sample code for java.lang.Throwable.getLocalizedMessage() definition code for java.lang.Throwable.getLocalizedMessage() , getMessage sample code for java.lang.Throwable.getMessage() definition code for java.lang.Throwable.getMessage() , getStackTrace sample code for java.lang.Throwable.getStackTrace() definition code for java.lang.Throwable.getStackTrace() , initCause sample code for java.lang.Throwable.initCause(java.lang.Throwable) definition code for java.lang.Throwable.initCause(java.lang.Throwable) , printStackTrace sample code for java.lang.Throwable.printStackTrace() definition code for java.lang.Throwable.printStackTrace() , printStackTrace sample code for java.lang.Throwable.printStackTrace(java.io.PrintStream) definition code for java.lang.Throwable.printStackTrace(java.io.PrintStream) , printStackTrace sample code for java.lang.Throwable.printStackTrace(java.io.PrintWriter) definition code for java.lang.Throwable.printStackTrace(java.io.PrintWriter) , setStackTrace sample code for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[]) definition code for java.lang.Throwable.setStackTrace(java.lang.StackTraceElement[]) , toString sample code for java.lang.Throwable.toString() definition code for java.lang.Throwable.toString()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Constructor Detail

AssertionError sample code for java.lang.AssertionError() definition code for java.lang.AssertionError()

public AssertionError()
Constructs an AssertionError with no detail message.


AssertionError sample code for java.lang.AssertionError(java.lang.Object) definition code for java.lang.AssertionError(java.lang.Object)

public AssertionError(Object sample code for java.lang.Object definition code for java.lang.Object  detailMessage)
Constructs an AssertionError with its detail message derived from the specified object, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.

If the specified object is an instance of Throwable, it becomes the cause of the newly constructed assertion error.

Parameters:
detailMessage - value to be used in constructing detail message
See Also:
Throwable.getCause() sample code for java.lang.Throwable.getCause() definition code for java.lang.Throwable.getCause()

AssertionError sample code for java.lang.AssertionError(boolean) definition code for java.lang.AssertionError(boolean)

public AssertionError(boolean detailMessage)
Constructs an AssertionError with its detail message derived from the specified boolean, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.

Parameters:
detailMessage - value to be used in constructing detail message

AssertionError sample code for java.lang.AssertionError(char) definition code for java.lang.AssertionError(char)

public AssertionError(char detailMessage)
Constructs an AssertionError with its detail message derived from the specified char, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.

Parameters:
detailMessage - value to be used in constructing detail message

AssertionError sample code for java.lang.AssertionError(int) definition code for java.lang.AssertionError(int)

public AssertionError(int detailMessage)
Constructs an AssertionError with its detail message derived from the specified int, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.

Parameters:
detailMessage - value to be used in constructing detail message

AssertionError sample code for java.lang.AssertionError(long) definition code for java.lang.AssertionError(long)

public AssertionError(long detailMessage)
Constructs an AssertionError with its detail message derived from the specified long, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.

Parameters:
detailMessage - value to be used in constructing detail message

AssertionError sample code for java.lang.AssertionError(float) definition code for java.lang.AssertionError(float)

public AssertionError(float detailMessage)
Constructs an AssertionError with its detail message derived from the specified float, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.

Parameters:
detailMessage - value to be used in constructing detail message

AssertionError sample code for java.lang.AssertionError(double) definition code for java.lang.AssertionError(double)

public AssertionError(double detailMessage)
Constructs an AssertionError with its detail message derived from the specified double, which is converted to a string as defined in The Java Language Specification, Second Edition, Section 15.18.1.1.

Parameters:
detailMessage - value to be used in constructing detail message