Consider:
class TestParent{
public int i = 100;
public void printName(){
System.err.println(this); //{TestChild@428} according to the Debugger.
Syste
Well when a new object is created that object has an address in memory so you can think of it as if the object had a private member this
that is set to the address when the object is created. You can also think of it like this: obj.method(param)
is just syntactic sugar for method(obj, param);
and this
is actually a parameter of method
.