Java View all facts Glossary Help |
member > member variable |
member variable comparison table |
Subject | associate with | is a subtopic of | take the place of | access from | overuse | access by | refer to | refer you | place in | represent | define by | use by | is a synonym of | mark as | allocate once for | allocate when | make | implement | be part of | declared in | belong to | used | define | refer to by | maintain | have | has definition | be |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
class variable | any instance of any class | Members | global variables used in other languages |
| other variables and methods in any class in the same package by default | a class or an object or a primitive datum | the state of a class | every method of the class | static variable | static | a class | the class is loaded | a class | the body of the class (not inside a method) | 1 class | to store | an attribute of an entire class | specifying the name of the class, followed by a dot, followed by the name of the variable | a name | A data item present in a class that is shared by all instances of that class | as private as possible | |||||||
instance variable | Members | all methods of its class | an object or a primitive | join the name of the variable with a dot to the instance variable name. Example: variableName.instanceVariableName | a class such that there is no needless duplication of it, and such that it is useful in all the subclasses of the class in which it is defined | an instance variable definition | object variable | private to prevent direct access to instance variable - accessor methods should be used instead to protect data abstraction | an attribute or an association | an object | part of its object's state | comment if it is non-obvious | Any item of data that is associated with a particular object. | as private as reasonably possible - almost never make an instance variable public | ||||||||||||||
member variable in an interface | Interfaces | other variables and methods in any class in the same package by default | a class or an object or a primitive datum | comment if it is non-obvious | static and final |
Next member: method Up: member, variable Previous member: instance member