Understanding the generated equality override in Java, line by line
When you override
hashCode() in a Java class, you should also override
hashCode(). You can certainly write
equals() yourself and then have your integrated development environment (IDE) generate
hashCode() for you.
There’s nothing wrong with that, provided that you understand what was generated and why. That’s what this article, the third of three…