Which statements are true?
a. With assertions enabled it prints "ABC" followed by an AssertionError message.
b. With assertions enabled it prints "ABCE" followed by an AssertionError message.
c. With assertions disabled it prints "ABC"
d. With assertions disabled it prints "ABCE"
e. Assertions should not be used within the default case of a switch statement.
f. A compiler error is generated.
g. None of the above.
//save as: C.java and compile it:
//C.java:8: warning: as of release 1.4, assert is a keyword, and may not be used a
s an identifier
assert false;
^
C.java:8: not a statement
assert false;
^
C.java:8: ';' expected
assert false;
^
2 errors
1 warning
The correct answer is A ,D, but why?
Thank you for your help!!
[Dan added formatting.]
[ February 27, 2003: Message edited by: Dan Chisholm ]