This repo demonstrates the importance of defining equals()
and hashCode()
methods.
The String
class comes with equals()
and hashCode()
definitions.
See what happens in ObjectExample when MyObj doesn't have equals()
and hashCode()
defined.