如果hashMap的两个key值对应的hash相同,即指向的数组下标相同,对应的值会是一个链表,每次put会把最新的值放到链表的最前面,get的时候循环链表里面的值判断key是否相同
public V put(K key, V value) {
if (table == EMPTY_TABLE) {
inflateTable(threshold);
}
if (key == null)
return putForNullKey(value);
int hash = hash(key);
int i = indexFor(hash, table.length);
for (Entry<K,V> e = table[i]; e != null; e = e.next) {
Object k;