Java   View all facts   Glossary   Help
member > member variable
Next membermethod    Upmember, variable    Previous memberinstance member   

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 variableany instance of any classMembersglobal variables used in other languages other variables and methods in any class in the same package by defaulta class or an object or a primitive datum  the state of a class every method of the classstatic variablestatica classthe class is loaded  a classthe body of the class (not inside a method)1 classto 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 attribute of an entire classspecifying the name of the class, followed by a dot, followed by the name of the variable a nameA data item present in a class that is shared by all instances of that classas private as possible
instance variable Members   all methods of its classan object or a primitivejoin 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 abstractionan attribute or an associationan object     part of its object's statecomment if it is non-obviousAny 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 defaulta class or an object or a primitive datum                  comment if it is non-obvious static and final

Next membermethod    Upmember, variable    Previous memberinstance member