Posts by Aloysio Figueiredo • 1 point
1 post
-
0
votes2
answers339
viewsA: Why does String hashcode() in Java use 31 as a multiplier?
Joshua Bloch, One of the developers of the Java platform, gave a good explanation in his book "Effective Java" (2nd Edition): The value 31 was chosen because it is an odd prime. If it were even and…