variable : Java Glossary


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.

This page is posted
on the web at:

Optional Replicator mirror
on local hard disk J:

Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

Your face IP:[]
You are visitor number