assert booleanExpression; assert booleanExpression : errorMessage;
The first form "assert booleanExpression" is used to test the boolean expression. If the boolean expression is false then Java throws AssertionError and your program terminates. The second form of assert keyword "assert booleanExpression : errorMessage" is more useful and provides a mechanism to pass an appropriate message when the assertion fails and Java throws AssertionError.
To enable the Java keyword assert in Eclipse you need to do the following steps:
Your lab assignment is to fix bugs in the four methods inside Recit4. Your TA will show you how to fix some of them, and you will fix the rest. Please complete this portion of the lab individually. You are always welcome to bring any lab material and questions to office hours.