Skip to content

Glossary: Coding Interviews in Java

assert

Also written: AssertionError, assertion, assertions

A Java statement that checks a condition is true and stops with an `AssertionError` if it isn't. Assertions are off by default, so you must run with `java -ea`.

Where the book teaches it

Related terms

java -eaTest method