While there might be implications of hash collisions for the effectiveness of the HashMap in Java, the minimal allowed hashCode implementation in Java is a simple return 0. HashMap is guaranteed to work even under these conditions correctly (but degenerates to a simple list performance-wise).
Editors:
Can someone please delete this article or edit/remove the security FUD at the end?
Thanks.
I would remove Effective Java (since this is one of the first books I recommend to beginners) and the Java Language Spec from the list and add for example:
"Java Concurrency in Practice" and "Programming in scala" .
The concurrency book since this is one of the hardest thing to get right and one of the best books on the topic and Programming in scala to expand the horizon and embrace the whole ecosystem.
Comments
Jun 09, 2017 · Artem Rukavytsia
True. I forgot about that.
Jun 09, 2017 · Artem Rukavytsia
If your Boss reads this comment, he might as well. But for unexpected reasons (see the other comments).
Jun 09, 2017 · Artem Rukavytsia
and yes Hashes collide. That is the basic concept of a hash function if hashes would not collide they would be utterly useless.
Jun 09, 2017 · Artem Rukavytsia
While there might be implications of hash collisions for the effectiveness of the HashMap in Java, the minimal allowed hashCode implementation in Java is a simple return 0. HashMap is guaranteed to work even under these conditions correctly (but degenerates to a simple list performance-wise).
Editors:
Can someone please delete this article or edit/remove the security FUD at the end?
Thanks.
Sep 06, 2013 · James Sugrue
I would remove Effective Java (since this is one of the first books I recommend to beginners) and the Java Language Spec from the list and add for example:
"Java Concurrency in Practice" and "Programming in scala" .
The concurrency book since this is one of the hardest thing to get right and one of the best books on the topic and Programming in scala to expand the horizon and embrace the whole ecosystem.