Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

== should never have been used for that method, which is very rarely what you want. The right thing is probably to deprecate == on nonprimitive types, replacing it with a longer name that's clearer about what it means.


Or make == call .equals and add a .referenceEquals method for the case where you actually want to check for reference equality.

This is what Scala and C# do.


That would indeed be nice, but is incompatible with Java's approach to backwards compatibility.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: