BlackRock interview question

Equals and HashCode in Java. Why do we need them?