Object Oriented Software Engineering   View all facts   Glossary   Help
subject > programming language construct > data item > variable > class variable
Next variableglobal variable    Upvariable    Previous variableattribute   

class variable
(static variable)
subjectfact 
class variablehas definition A data item present in a class that is shared by all instances of that class2001-08-30 14:54:52.0
has a value that is shared by all instances of a class2001-08-30 14:54:52.0
has purpose storing:
  • Default or 'constant' values that are widely used by methods in a class
  • Lookup tables and similar structures used by algorithms inside a particular class
2001-08-30 14:54:52.0
is a subtopic of The Basics of Java2001-08-30 14:54:52.0
is shared by all instances of the class2001-08-30 14:54:52.0
is a kind of variable2001-08-30 14:54:52.0
should not be overused2001-08-30 14:54:52.0
is a synonym of static variable2001-08-30 14:57:47.0
variablecan contain different classes of objects depending on the type of the variable2001-08-30 14:58:18.0
can refer to a particular object, several different objects during the execution of a program, or no object at all2001-08-30 14:58:18.0
has scope2001-08-30 14:58:18.0
has type2001-08-30 14:58:19.0

Kinds of class variable :