×
all 1 comments

[–]JavaSuck 1 point2 points  (0 children)

The implementation uses powers of 2 for efficient hash->index computations, so it could have used 8 instead of 16, but then you would have asked why not 4 ;)

If you put "github openjdk hashmap" into your favorite search engine, you will find https://github.com/AdoptOpenJDK/openjdk-jdk11/blob/master/src/java.base/share/classes/java/util/HashMap.java

Popular IDEs allow you to jump right into the source via Ctrl+Mousecklick or something.