Often I see in hashcode implementation examples multiplying some member variable by 37 (or some prime number).
What is the purpose of this? My guess would be this is to help the case when you have two objects such that Without that multiplier, both would have the same hashcode (which is okay, but maybe less efficient). Is there another purpose to this?
Joined: Dec 28, 2006
From what I understand the prime numbers are used for avoiding collisions.