Contracts Slide 11 of 48 Contracts Contracts on a class enable caller and callee to share the same assumptions about the class.
Invariants are constraints associated with classes or interfaces.
Invariants are used to specify consistency constraints among class attributes. A predicate that must be true before an operation is invoked. Preconditions are associated with a specific operation. Preconditions are used to specify constraints that a caller must meet before calling an operation. A predicate that must be true after an operation is invoked.