192k views
2 votes
What is a class invariant?

User Stasia
by
8.3k points

1 Answer

5 votes

Answer:

In computer programming, specifically object-oriented programming, a class invariant is an invariant used for constraining objects of a class. Methods of the class should preserve the invariant. The class invariant constrains the state stored in the object

User Laylaylom
by
8.3k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories