previous
|
start
|
next
Assertions
Assertion = assumption that you believe to be true
assert y >= 0;
root = Math.sqrt(y);
If assertion fails, program is terminated
Can be used to assert pre/postconditions
Must compile/run with special flags
javac -source 1.4 MyProg.java
java -enableassertions MyProg
previous
|
start
|
next