Java Glossary : variable

CMP home Java glossary home Menu no menu Last updated 2004-06-28 by Roedy Green ©1996-2004 Canadian Mind Products

Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

You are here : home : Java Glossary : V words : variable.

variable
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.


CMP logo
CMP_home
home
Canadian Mind Products CSS
HTML Checked!
ICRA ratings logo
mindprod.com IP:[24.87.56.253]
Your IP:[80.134.30.163]
You are visitor number 1878.
Please send errors, omissions and suggestions
to improve this page to Roedy Green.
You can get a fresh copy of this page from: or possibly from your local J: drive mirror:
http://mindprod.com/jgloss/variable.html J:\mindprod\jgloss\variable.html