February 2014
Beginner
1248 pages
62h 25m
English
Every object can access a reference to itself with keyword this (sometimes called the this reference). When an instance method is called for a particular object, the method’s body implicitly uses keyword this to refer to the object’s instance variables and other methods. This enables the class’s code to know which object should be manipulated. As you’ll see in Fig. 8.4, you can also use keyword this explicitly in an instance method’s body. Section 8.5 shows another interesting use of keyword this. Section 8.11 explains why keyword this cannot be used in a static method.
Read now
Unlock full access