0

What is 'this' keyword?

I've searched the internet and I still don't know what does it mean. I don't understand what they say this is.

2nd Dec 2019, 6:18 PM
varFildom_
varFildom_ - avatar
3 Answers
+ 4
Edit: "this" keyword is used to point the current object or you can call it a reference to the current object. Using it you can assign values to your instance variables inside a constructor or an instance method.
2nd Dec 2019, 6:34 PM
Avinesh
Avinesh - avatar
+ 1
Thank you!
2nd Dec 2019, 8:27 PM
varFildom_
varFildom_ - avatar
+ 1
let us take an example, suppose your friend is visiting you at your house then in this case the house is your class. Secondly you can say to your friend that "this" is my house and i have the rights to shift the Sofa from here to there.
3rd Dec 2019, 4:46 AM
minirkk
minirkk - avatar