- Returns an int for any object
- Use to store objects in hash tables
- Hash-tables have constant-time
O(1)lookup
Hashcode needs to be consistent with equals:
x.equals(y) => x.hashcode() == y.hashcode()A collision occurs when two objects with the same hashcode are not equal.