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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can c++ be faster than c?

769


What is atoi in c++?

790


What is the use of default constructor?

783


What is the rule of three?

751


Where do I find the current c or c++ standard documents?

805






Why isn't sizeof for a struct equal to the sum of sizeof of each member?

721


Which should be more useful: the protected and public virtuals?

756


Define pre-condition and post-condition to a member function in c++?

869


What do nonglobal variables default to a) auto b) register c) static

860


Write a program to find the Fibonacci series recursively.

806


What is the benefit of encapsulation?

801


How many types of modularization are there in c++?

756


Is c++ a difficult language?

751


Why do you use the namespace feature?

846


What is endl c++?

822