what is the use of this.color in reference to the topic getter and setter??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what is the use of this.color in reference to the topic getter and setter???

11th Sep 2016, 7:47 AM
Nikhil Mittal
Nikhil Mittal - avatar
2 Answers
+ 3
The keyword "this" is used to refer to the current object. Fundamentally this.color is the color attribute of the current object. I hope it is helpful...
11th Sep 2016, 7:53 AM
Shafiq Bangulzai
Shafiq Bangulzai - avatar
0
this keyword is self reference pointer by using this you can point point the address of the variable and get valued
19th Sep 2016, 2:16 PM
jineha