Which of the following are true of the code? (Choose all that apply.)
4: private int addPlusOne(int a, int b) { 5: boolean assert = false; 6: assert a++ > 0; 7: assert b > 0; 8: return a + b; 9: }
A, E.
Line 5 does not compile because assert is a reserved word making Choice A correct.
B and C are incorrect because the parenthesis and message are both optional.
D is incorrect because assertions should not have side effects.
E is correct because checking an argument passed from elsewhere in the program is an appropriate use of an assertion.