variable : Java Glossary

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 homejump to top You can get the freshest copy of this page from: or possibly from your local J: drive (Java virtual drive/mindprod.com website mirror)
http://mindprod.com/jgloss/variable.html J:\mindprod\jgloss\variable.html
logo
Please email your , letters to the editor, errors, omissions, typos, formatting errors, ambiguities, unclear wording, broken/redirected link reports, suggestions to improve this page or comments to Roedy Green : feedback email. If you want your message, your name or email kept confidential, not considered for public posting, please explicitly specify that. Unless you state otherwise, I will treat your message as a letter to the editor that I may or may not publish in the feedback section. After that, it will be too late to retract it. If you disagree with something I said, please quote it and cite the web page where you found it, tell me why you think it is wrong, and, if possible, provide some supporting evidence. Threatening to kill me or spouting obscenities has yet to persuade me to change my mind.
mindprod.com IP:[65.110.21.43]
view BlogYour face IP:[38.107.179.214]
You are visitor number 21,625.