How WeakHashMap works under the hood
问题 I invesigate WeakHashMap ource code to have more knowledge about WeakReference I have found that entry looks like this: private static class Entry<K,V> extends WeakReference<Object> implements Map.Entry<K,V> { V value; final int hash; Entry<K,V> next; /** * Creates new entry. */ Entry(Object key, V value, ReferenceQueue<Object> queue, int hash, Entry<K,V> next) { super(key, queue); this.value = value; this.hash = hash; this.next = next; } ... Thus when we create new entry we invoke super(key,