Skip to content

Most visited

Recently visited

navigation
Added in API level 1

AssertionError

public class AssertionError
extends Error

java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Error
       ↳ java.lang.AssertionError
Known Direct Subclasses
Known Indirect Subclasses


Thrown when an assertion has failed.

Summary

Public constructors

AssertionError()

Constructs a new AssertionError with no message.

AssertionError(String detailMessage, Throwable cause)

Constructs a new AssertionError with the given detail message and cause.

AssertionError(Object detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(Object) with the specified object.

AssertionError(boolean detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(boolean) with the specified boolean value.

AssertionError(char detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(char) with the specified character value.

AssertionError(int detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(int) with the specified integer value.

AssertionError(long detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(long) with the specified long value.

AssertionError(float detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(float) with the specified float value.

AssertionError(double detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(double) with the specified double value.

Inherited methods

From class java.lang.Throwable
From class java.lang.Object

Public constructors

AssertionError

Added in API level 1
AssertionError ()

Constructs a new AssertionError with no message.

AssertionError

Added in API level 19
AssertionError (String detailMessage, 
                Throwable cause)

Constructs a new AssertionError with the given detail message and cause.

Parameters
detailMessage String
cause Throwable

AssertionError

Added in API level 1
AssertionError (Object detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(Object) with the specified object. If the object is an instance of Throwable, then it also becomes the cause of this error.

Parameters
detailMessage Object: the object to be converted into the detail message and optionally the cause.

AssertionError

Added in API level 1
AssertionError (boolean detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(boolean) with the specified boolean value.

Parameters
detailMessage boolean: the value to be converted into the message.

AssertionError

Added in API level 1
AssertionError (char detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(char) with the specified character value.

Parameters
detailMessage char: the value to be converted into the message.

AssertionError

Added in API level 1
AssertionError (int detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(int) with the specified integer value.

Parameters
detailMessage int: the value to be converted into the message.

AssertionError

Added in API level 1
AssertionError (long detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(long) with the specified long value.

Parameters
detailMessage long: the value to be converted into the message.

AssertionError

Added in API level 1
AssertionError (float detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(float) with the specified float value.

Parameters
detailMessage float: the value to be converted into the message.

AssertionError

Added in API level 1
AssertionError (double detailMessage)

Constructs a new AssertionError with a message based on calling valueOf(double) with the specified double value.

Parameters
detailMessage double: the value to be converted into the message.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.