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.
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.
+ 1
Thank you!
+ 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.