Counter class (cont.)
nAdding a method decrementCount threatens the class invariant constraint that tally be greater than or equal to zero.
n
npublic void decrementCount () {
n tally = tally - 1;
n}
nWe must guard the assignment statement with a condition statement.