I have read that in Java you don't have to explicitly bind the this keyword to object, it is done by interpreter. It is opposite to Javascript where you always have to know the value of this. But where is this in Java is pointing - to class or object ? Or does it vary ? This question is a part of my attempt to understand basic OO concepts and design patterns so I can apply them to Javascript. Thank you.
In Java, this always refers to an object and never to a class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With