variable : Java Glossary
©1996-2017 Roedy Green of Canadian Mind Products
There are several types of variables. My personal preferred terms for each are show
in bold. Variables take on different values at different stages in
the execution. You can have variables that are part of the class
(static class variables), variables that are part of an
object (instance variables). Collectively static variables
and instance variables are called member variables, or just
members. Variables defined inside a method are called
local, temporary or stack variables.
Static final variables are called constants by normal
humans and values by the Java Language spec.
Fields collectively refer to static class variables,
instance variables and static final constants defined inside classes, but outside
methods. There is one copy of each static variable per class, one
copy of each instance variable per instantiated object and one copy
of each local variable for each incarnation of its enclosing method
currently executing. Static is a strange word, inherited from C. I use it in
preference to class variable because it matches the keyword used in code. There is no
corresponding explicit keyword for instance. A variable is declared
instance by the lack of the keyword static. There is similarly no
keyword local. You create local declarations using identifiers otherwhere
declared as types in the middle of a method. There is no obvious visual clue.