What is this keyword in OOP

What is “this”?

You may have noticed something slightly strange in our methods. Look at this one for example:

You are probably wondering what “this” is. The this keyword refers to the current object the code is being written inside — so in this case this is equivalent to person.

Spread the love