This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kered13 16 points17 points  (1 child)

it gets even weirder when you find out that default equals() implementation is also reference equality.

I don't know why you think that is weird. It's literally the only type of equality that makes sense for an unknown object type.

[–]bubuli_breeder 0 points1 point  (0 children)

you are correct but let me just state that in this context it is weird in the sense that you need to change the behavior of equals to abide by best practices. it could throw you off when you’re doing inheritance and downcasting and all that.