
402 CHAPTER 7 Object-Oriented Programming,Part 2: User-Defined Classes
When a method begins executing, the JVM sets the object reference, this, to
refer to the object for which the method has been called. That object is
called the implicit parameter. When a method references an instance vari-
able, it will access the instance variable that belongs to the object that the
implicit parameter references. In other words, by default, any instance vari-
able referred to by a method is considered to be this.instanceVariable.
Preceding an instance variable name with this is optional; when just the
instance variable name is used (without any object reference), ...