In Item 2 of the \"Effective Java, 2nd edition\" book, there is this snippet of code, in which the author wants to forbid the empty initialization of an object.
AssertionError is an Unchecked Exception which rises explicitly by programmer or by API Developer to indicate that assert statement fails.
assert(x>10);
Output:
AssertionError
If x is not greater than 10 then you will get runtime exception saying AssertionError.