What is class invariant in c++, Computer Engineering

A class invariant is a condition that describes all valid states for an object. It is a logical condition to make sure the correct working of a class. Class invariants must hold when an object is formed, 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.

 

 

Posted Date: 4/8/2013 3:36:31 AM | Location : United States







Related Discussions:- What is class invariant in c++, Assignment Help, Ask Question on What is class invariant in c++, Get Answer, Expert's Help, What is class invariant in c++ Discussions

Write discussion on What is class invariant in c++
Your posts are moderated
Related Questions
What are the different ways in which a thread can be cancelled?  Cancellation of a target thread may occur in two different scenarios: Asynchronous cancellation: One thre

Q. Explain about data registers? The data registers are used just for storing intermediate results or data and not for operand address calculation. Some dedicated address re

Write a short notes on storage classes in C. Every variable and function in C has two attributes : type and storage class. The four storage classes are automatic, external, reg

design a gray to bcd code converter using 16:1 de multiplexe

calculate the time complexity of a=(b/c) operation in stack

Explain clearly the four stages in the Rapid Application Development

First Order Predicate Logic This is a more expressive logic because it builds on propositional logic by allowing us to use constants, predicates, variables, quantifiers and fun

Explain in detail about Operating Systems (OS) Operating system (OS) is a program which after being initially loaded into computer by a boot program, manages all the other appl

Use the colon operation to create a vector x of numbers -10 through 10 in steps of 1. Use matrix operations to create a vector y where each element is 5 more than 2 times the corre

Give difference between top down parsing and bottom up parsing. Top down parsing: Specified an input string, top down parsing tries to derive a string identical to this by s