title: Why does Java use (hash & 0x7FFFFFFF) % tab.length to decide the index of a key?
body: <p>From the link below, I know Java uses <code>(hash &amp; 0x7FFFFFFF) % tab.length</code> to decide which slot of an array to put the {key, value} in.</p>
  
  <p><a href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/Hashtable.java#Hashtable.put%28java.lang.Object%2Cjava.lang.Object%29">http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/7-b147/java/util/Hashtable.java#Hashtable.put%28java.lang.Object%2Cjava.lang.Object%29</a></p>
  
  <p>My question is why Java first does hash &amp; 0x7FFFFFFF? Is there any particular purpose?</p>