These variables are formally known as instance variables because they contain the state for a particular bicycle object, and in object-oriented terminology, a particular object is called an instance . The following figure illustrates a bicycle modeled as a software object. In addition to its variables, the software bicycle would also have methods to brake, change the pedal cadence, and change gears. These methods are formally known as instance methods because they inspect or change the state of a particular bicycle instance. The object diagrams show that the object's variables make up the center, or nucleus, of the object.
Methods surround and hide the object's nucleus from other objects in the program.
However, it's not the whole story. Often, for practical reasons, an object may wish to expose some of its variables or hide some of its methods. In the Java programming language, an object can specify one of four access levels for each of its variables and methods. The access level determines which other objects and classes can access that variable or method. Variable and method access in Java is covered in Controlling Access to Members of a Class .