![]() |
subject > programming language construct > data item > variable > class variable > Java class variable |
![]() ![]() | ||||||||||||
Java class variable comparison table |
Subject | serve as | declare by | have | be | is a kind of | is a synonym of | have purpose | access by | declared in | has definition | mark as | share by |
---|---|---|---|---|---|---|---|---|---|---|---|---|
class variable | a value that is shared by all instances of a class | variable | static variable | storing: | A data item present in a class that is shared by all instances of that class | all instances of the class | ||||||
Java variable | giving the data type followed by the name of the variable | an interface as its type which means that, with the variable, you can invoke any operation supported by the interface | as private as possible | variable | other variables and methods in any class in the same package by default | |||||||
Java class variable | a global variable | giving the data type followed by the name of the variable | a value that is shared by all instances of a class | as private as possible | Java variable | storing: | specifying the name of the class, followed by a dot, followed by the name of the variable | the body of the class (not inside a method) | static | all instances of the class |