Java‎ > ‎

Assertion

Java Assertion Example

assert args.length == 3: "Bad number of command line arguments";

Note that to enable assertion, you would need to run java using the -ea (enable assertion) flag

java -ea -jar myprogram.jar


Comments