member variable | bold = mandatory italic = non-terminal normal font = optional | the block where it is declared | | | | | giving the data type followed by the name of the variable | | other variables and methods in any class in the same package by default | a class or an object or a primitive datum | value | | only values that are of the same type as the variable or a subtype of the variable's type | | to refer to an object or a class or a primitive datum | field | | | | | | | variable | | an assignment statement | | | | the code in its class | a class outside of a method | a class or an object | comment if it is non-obvious | | as private as possible | class variable, instance variable |
class variable | bold = mandatory italic = non-terminal normal font = optional | the block where it is declared | any instance of any class | Members | global variables used in other languages | | giving the data type followed by the name of the variable | | other variables and methods in any class in the same package by default | a class or an object or a primitive datum | value | the state of a class | only values that are of the same type as the variable or a subtype of the variable's type | every method of the class | to refer to an object or a class or a primitive datum | static variable | static | a class | the class is loaded | a class | the body of the class (not inside a method) | 1 class | member variable | to store - default or 'constant' values that are widely used by methods in a class
- lookup tables and similar structures used in algorithms in a particular class
| an assignment statement | an attribute of an entire class | | specifying the name of the class, followed by a dot, followed by the name of the variable | the code in its class | a class outside of a method | a class or an object | a name | A data item present in a class that is shared by all instances of that class | as private as possible | |