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:

    The prostitute is the scapegoat for everyone’s sins, and few people care whether she is justly treated or not. Good people have spent thousands of pounds in efforts to reform her, poets have written about her, essayists and orators have made her the subject of some of their most striking rhetoric; perhaps no class of people has been so much abused, and alternatively sentimentalized over as prostitutes have been but one thing they have never yet had, and that is simple legal justice.
    —Alison Neilans. “Justice for the Prostitute—Lady Astor’s Bill,” Equal Rights (September 19, 1925)

    Walked forth to ease my pain
    Along the shore of silver streaming Thames,
    Whose rutty bank, the which his river hems,
    Was painted all with variable flowers,
    Edmund Spenser (1552?–1599)