Jump to content

Class variable

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 72.207.36.159 (talk) at 18:06, 17 October 2010 (typo: "another named for" should have been "another name for"). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

in object-oriented programming with classes, a class variable is another name for a class-level data member. Or a member that is scoped at the class level, rather than having a scope within a method. In many languages (such as Java or C#), a class-level variable is instance-agnostic, that is whether or not it is declared as static or instance is immaterial. In some languages however (such as C++), a class variable refers to a static member (a single copy exists, regardless of how many instances of the class exist).