Java   View all facts   Glossary   Help
member > class member > class variable
Next class memberclass method    Upclass member, member variable

class variable
(static field, static member variable, static variable)
subjectfact 
class variablebelongs to 1 classadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:25.0
can be accessed from added by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:25.0
can be used to store
  • default or 'constant' values that are widely used by methods in a class
  • lookup tables and similar structures used in algorithms in a particular class
  
source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:25.0
defines an attribute of an entire classadded by: JK, source: Teach Yourself Java 2 in 21 Days, 2001-10-19 11:36:25.0
has definition A data item present in a class that is shared by all instances of that class    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:25.0
has a value that is shared by all instances of a class    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:25.0
has a nameadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:25.0
is part of a classadded by: JK, 2001-10-19 11:36:26.0
is a subtopic of Members2001-10-19 11:36:26.0
is allocated once for a classadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:26.0
is allocated when the class is loadedadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:26.0
is declared in the body of the class (not inside a method)    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:26.0
is marked as static    source: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:26.0
is not associated with any instance of any classadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:26.0
is referred to by specifying the name of the class, followed by a dot, followed by the name of the variablesource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:26.0
is a kind of class memberadded by: JK, 2001-10-19 11:36:26.0
is a kind of member variableadded by: DS, source: Sun Java Tutorial, 2001-10-19 11:36:26.0
represents the state of a classadded by: DS, question: do we want this? A&G say yes, 2001-10-19 11:36:26.0
should not be overusedsource: Object Oriented Software Engineering by Lethbridge and Laganière, 2001-10-19 11:36:26.0
takes the place of global variables used in other languagesadded by: JK, source: On To Java, 2001-10-19 11:36:26.0
is a synonym of static field2001-10-19 11:37:58.0
is a synonym of static member variable2001-10-19 11:37:58.0
is a synonym of static variable2001-10-19 11:37:58.0
class membercan be used by every method of the class2001-10-19 11:36:23.0
member variablecan be declared anywhere in a class outside of a method2001-10-19 11:37:20.0
can be initialized by an assignment statement2001-10-19 11:37:20.0
is a member of a class or an object2001-10-19 11:37:20.0
is accessible to the code in its class2001-10-19 11:37:20.0
variablecan be accessed by other variables and methods in any class in the same package by default    2001-10-19 11:38:12.0
can contain different classes of objects depending on the type of the variable2001-10-19 11:38:12.0
can contain only values that are of the same type as the variable or a subtype of the variable's type2001-10-19 11:38:12.0
can refer to a particular object, several different objects during the execution of a program, or no object at all    2001-10-19 11:38:13.0
has purpose to refer to an object or a class or a primitive datum2001-10-19 11:38:13.0
has scope2001-10-19 11:38:13.0
has part value2001-10-19 11:38:13.0
is declared by giving the data type followed by the name of the variable    2001-10-19 11:38:13.0
is destroyed in the block where it is declared2001-10-19 11:38:13.0
may have access modifier 2001-10-19 11:38:13.0
refers to a class or an object or a primitive datum2001-10-19 11:38:13.0
should be as private as possible2001-10-19 11:38:13.0
access unithas access mode2001-10-19 11:35:59.0
syntactic unithas syntax rule
bold = mandatory
italic = non-terminal
normal font = optional
2001-10-19 11:38:04.0

Next class memberclass method    Upclass member, member variable