Venkatesh Cbit
Venkatesh Cbit
What is equals()
Method?
Purpose:
Compares two objects for logical equality.
Default Behavior:
Defined in object class.
compares objects references(memory location).
What is hashCode()
Method?
•Returns an integer hash value used by hash-based collections like HashMap, HashSet.
Syntax:
• When objects are used in collections like HashMap or HashSet, their hash codes are used to
place them in appropriate buckets for efficient retrieval.