posted 20 years ago
hi all!!!
Presently I was working through some questions on assertions.I came across the words class invariant and internal invariant.What does they mean???
please give me the answer.
this is a question regarding the assertions.Given below are the answers.I was pretty sure that the answers a & b are right.I did not understand answers c and d.Please explain.
a.)With assertions enabled it prints an error message.
b.)With assertions disabled it prints: true,true,false
c.)The combination of the if/else statements and the assert statement indicate that the programmer expects no more than one boolean, b1, b2 or b3, to be true.
d.)The assert statement is being used to check an internal invariant
(code tags added - Barry)
[ May 05, 2004: Message edited by: Barry Gaunt ]