HashMap
li_cangqiong
web之路慢慢爬...
展开
-
HashMap的putVal源码解析
先贴代码 /** * Implements Map.put and related methods * * @param hash 根据静态方法hash获得的hash值 * @param key 键 * @param value 值 * @param onlyIfAbsent if true,当键相同时,不修改已存在的值 *...原创 2018-08-20 16:07:05 · 1238 阅读 · 0 评论 -
HashMap源码解析之resize()扩容
final Node<K,V>[] resize() { Node<K,V>[] oldTab = table;//将当前table暂存到oldtab来操作 int oldCap = (oldTab == null) ? 0 : oldTab.length; int oldThr = threshold; i...原创 2018-08-20 19:27:58 · 2121 阅读 · 1 评论