What are the conditions that have to be met for a condition to be an invariant of the class?



What are the conditions that have to be met for a condition to be an invariant of the class?..

Answer / atul shankhwar

 The condition should hold at the end of every constructor.

 The condition should hold at the end of every mutator(non-const) operation.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Give 10 points of differences between C & C++.

0 Answers   HCL,


What are manipulators in c++ with example?

0 Answers  


List down the guideline that should be followed while using friend function.

0 Answers  


What is a lambda function c++?

0 Answers  


Differentiate between a constructor and a method in C++.

0 Answers   Tech Mahindra,






What is a friend function in c++?

0 Answers  


Differentiate between a template class and class template?

1 Answers  


What is constructor c++?

0 Answers  


How can you create a virtual copy constructor?

0 Answers  


Is linux written in c or c++?

0 Answers  


without if else statement can be written ah

0 Answers  


catch(exception &e) { . . . } Referring to the sample code above, which one of the following lines of code produces a written description of the type of exception that "e" refers to? a) cout << e.type(); b) cout << e.name(); c) cout << typeid(e).name(); d) cout << e.what(); e) cout << e;

2 Answers   Quark,


Categories