What is the standard idiom for implementing equals and hashCode in Scala?

Jim Hurne picture Jim Hurne · Sep 10, 2011 · Viewed 9.6k times · Source

What is the standard idiom for implementing the equals and hashCode methods in Scala?

I know the preferred approach is discussed in Programming in Scala, but I don't currently have access to the book.

Answer

Daniel C. Sobral picture Daniel C. Sobral · Sep 15, 2011

There's a free 1st edition of PinS that discuss this subject just as well. However, I think the best source is this article by Odersky discussing equality in Java. The discussion in PinS is, iirc, an abbreviated version of this article.