Internals of the OpenJDK - HashMap

Here is the implementation of HashMap from OpenJDK 6.  It is interesting how simple it truly is.  Essentially HashMap consists of an array called 'table'.  On the 'put' call, we use the hashcode of the key and then call another hash function, then convert that into an index into the array.  Place the 'value' object at the index array position.

OpenJDK HashMap Implementation

Comments

Popular posts from this blog

Is Java the new COBOL? Yes. What does that mean, exactly? (Part 1)

On Unit Testing, Java TDD for developers to write

JVM Notebook: Basic Clojure, Java and JVM Language performance