An error that occurs due to an incorrectly written program.
An instance is thrown when an assertion fails, that is,
when a condition in an assert statement evaluates to
false at runtime.
The assertion
"x must be positive" assert (x>0);
has almost the same effect as this if statement
if (!x>0) {
throw AssertionError("x must be positive");
}
| Initializer |
AssertionError(String message)Parameters:
|