Object Oriented Software Engineering View all facts Glossary Help |
subject > programming language construct > data item > variable > class variable > Java class variable |
Java class variable | ||||
subject | fact |
Java class variable | can serve as a global variable | |
is a subtopic of The Basics of Java | ||
is accessed by specifying the name of the class, followed by a dot, followed by the name of the variable | ||
is declared in the body of the class (not inside a method) | ||
is marked as static | ||
is a kind of class variable | ||
is a kind of Java variable | ||
Java variable | can have an interface as its type which means that, with the variable, you can invoke any operation supported by the interface | |
is declared by giving the data type followed by the name of the variable | ||
should be as private as possible | ||
class variable | has a value that is shared by all instances of a class | |
has purpose storing: | ||
is shared by all instances of the class | ||
should not be overused | ||
variable | can contain different classes of objects depending on the type of the variable | |
can refer to a particular object, several different objects during the execution of a program, or no object at all | ||
has scope | ||
has type |