Note that a
. b
and c
are instances of primitive wrapper classes (such as Integer, Double, etc…). These classes are final and cannot be extended, so you can’t override their equals
implementation.
Therefore a.equals(a)
will always return true, since those classes implement equals
properly.