posted 22 years ago
http://www.danchisholm.net/dec04/topic/section2/assertions2.html
Question 9
Which statements are true?
a. With assertions enabled it prints an AssertionError message.
b. With assertions enabled it prints nothing.
c. With assertions disabled it prints an AssertionError message.
d. With assertions disabled it prints nothing.
e. An assertion should not be placed at any location that the programmer believes will never be reached under normal operating conditions.
f. The assert statement is being used to check a control-flow invariant to verify that the control flow never reaches a point in the program.
g. A compiler error is generated.
h. None of the above.
According to the answers option "f" is correct
But in this code assert statement is placed at a place where it will always be called no matter what is the value of b1,b2,b3, since there are no return statements in the if-the-else statements.
I feel "f" may not be the correct option.
Dan can you pls confirm !
--Shweta<br />SCJP 1.4 <br />SCWCD