Campus interview zone
Would you like to react to this message? Create an account in a few clicks or log in to continue.

What is class invariant?

Go down

What is class invariant? Empty What is class invariant?

Post  Admin Sun Jan 31, 2010 5:33 pm

Answer:
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.

Admin
Admin

Posts : 71
Join date : 2010-01-21

http://campus-interview.co.cc

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum