What is class invariant?
Answer / subham chaudhary
A class invariant is a condition that defines all valid states for an object. It is a logical condition to ensure the correct working of a class. Class invariants must hold when an object is created, and they must be preserved under all operations of the class. In particular all class invariants are both preconditions and post-conditions for all operations or member functions of the class.
Is This Answer Correct ? | 0 Yes | 0 No |
Where and why do I have to put the "template" and "typename" keywords?
Is overriding possible in c++?
What is nested class in c++?
How can we access protected and private members of a class?
Describe public access specifiers?
List the issue that the auto_ptr object handles?
What is code reusability in c++?
How would you represent an error detected during constructor of an object?
What is difference between shallow copy and deep copy? Which is default?
What is #include iostream in c++?
What is a dangling pointer in c++?
How to access a variable of the structure?