Slide 17
Slide 17 text
Javier Gonzalez-Sanchez | CSE110 | Summer 2020 | 17
this
• The this reference refers to its class itself and can be
used to refer to the instance variables of an object
of the class.
• You can create an instance variable and a local
variable using a same name (compiles), but it is
confusing!
• In such case, local variables will be used, and
instance variables will be ignored. We can use the
this reference to refer to instance variables to
distinguish them.