Jump to content

Class variable

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Vera Cruz (talk | contribs) at 16:13, 16 January 2003. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In computer science's object-oriented programming, class variables contains information that is shared by all instances of a class. If all tanks have one cannon then it is not necessary to specify an instance variable for each tank object (object-oriented programming); rather, one cannot simply define a class variable and thus all instances of the class will share the variable.