This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Often I see in hashcode implementation examples multiplying some member variable by 37 (or some prime number).
For example,
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?
Thanks, Jeff
Remko Strating
Ranch Hand
Joined: Dec 28, 2006
Posts: 893
posted
0
From what I understand the prime numbers are used for avoiding collisions.