Skip to content

Latest commit

 

History

History
7 lines (4 loc) · 293 Bytes

File metadata and controls

7 lines (4 loc) · 293 Bytes

Java equality and contains example

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.