HashMap源码之resize()函数逐行解读
final Node<K,V>[] resize()
resize() 方法的作用是对哈希表进行初始化或者扩容。
final Node<K,V>[] resize() {
Node<K,V>[] oldTab = table;
int oldCap = (oldTab == null) ? 0 : oldTab.length;
int oldThr = threshold;
int newCap, newTh
原创
2022-04-11 11:07:22 ·
792 阅读 ·
2 评论