Title: Key Concept - Assert statement
Course: CPS 189: Java Certification - Review, Practice & Prepare (Development) > Section: Learning Modules

The assert statement is a debugging tool.

The assert statement checks a condition.

- If the condition is true, the application continues.
- If the condition is false, the application ends with a run-time error.

assert statement syntax:

- assert (<boolean-expression>);

To use the assert statement, the –ea parameter must be specified in the run command.

For additional study, view resources under:

- Level 2 Study Materials: Unit 1