Instance variable

From GNUstepWiki

(Difference between revisions)
Revision as of 14:17, 30 August 2005
Cbv (Talk | contribs)

← Previous diff
Revision as of 14:25, 14 November 2005
Comrade (Talk | contribs)
Clarifying that instance variables do not share values between instances
Next diff →
Line 1: Line 1:
-Any variable that is part of a class's internal data structure.+Each instance of a class may have a local copy of one or more variables which are known as instance variables, and which may contain unique properties or values associated with that instance. These variables are not shared between instances of a class.
Instance variables are declared in the class's [[Interface]] and become part of any objects which are members of, or inherit from, the class. Instance variables are declared in the class's [[Interface]] and become part of any objects which are members of, or inherit from, the class.
-Instance variables are also referred to as ivars.+Instance variables are also referred to as ivars.
 + 
 +Compare with the concept of a [[Class variable]].

Revision as of 14:25, 14 November 2005

Each instance of a class may have a local copy of one or more variables which are known as instance variables, and which may contain unique properties or values associated with that instance. These variables are not shared between instances of a class.

Instance variables are declared in the class's Interface and become part of any objects which are members of, or inherit from, the class.

Instance variables are also referred to as ivars.

Compare with the concept of a Class variable.