Two objects have the same references, surely the same?
Does line 26 really return true?
No, it never returns
unless you pass the exact same object reference to it.
The reason for this is that Java objects are not "embedded" within each other: there is a reference to
, but it refers to a completely different object. Therefore, "false downgrade" is not possible: the place where the class reference is stored
inside the class instance
does not match the place where it is stored
source to share