摘要:
1添加源码 final V putVal(K key, V value, boolean onlyIfAbsent) { if (key == null || value == null) throw new NullPointerException(); int hash = spread(key 阅读全文
摘要:
subList是arrayList的内部类 private class SubList extends AbstractList<E> implements RandomAccess { private final AbstractList<E> parent; private final int 阅读全文
摘要:
public class LRUCache { int cap; LinkedHashMap<Integer, Integer> linkedHashMap = new LinkedHashMap<>(); LRUCache(int cap){ this.cap = cap; } public in 阅读全文
摘要:
1.源码全集如下 查看代码 public class HashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneable, Serializable { @java.io.Serial private static final l 阅读全文