Class Variable

In object-oriented programming with classes, a class variable is a variable defined in a class (i.e. a member variable) of which a single copy exists, regardless of how many instances of the class exist.

A class variable is not an instance variable. It is a special type of class attribute (or class property, field, or data member).

In Java, C#, and C++, class variables are declared with the keyword static, and may therefore be referred to as static member variables.

The same dichotomy between instance and class members applies to methods ("member functions") as well; a class may have both instance methods and class methods. Again, Java, C#, and C++ use the keyword static to indicate that a method is a class method ("static member function").

Read more about Class Variable:  Example

Famous quotes containing the words class and/or variable:

    What exacerbates the strain in the working class is the absence of money to pay for services they need, economic insecurity, poor daycare, and lack of dignity and boredom in each partner’s job. What exacerbates it in upper-middle class is the instability of paid help and the enormous demands of the career system in which both partners become willing believers. But the tug between traditional and egalitarian models of marriage runs from top to bottom of the class ladder.
    Arlie Hochschild (20th century)

    There is not so variable a thing in nature as a lady’s head-dress.
    Joseph Addison (1672–1719)