Jump to content

Class variable

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Nick Number (talk | contribs) at 18:16, 18 August 2010 (sp refers WP:TYPO). 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 named 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).