呵呵呵,原理nmb. HashTable,HashMap,ConcurrentHashMap 当你作为一个菜鸡的时候,别人就会那这个来问你. 为什么要用ConcurrentHashMap,因为HashMap不是线程安全的,这种线程不安全性体现在进行迭代的时候,也就是用Iterator进行访问. 问题来了,呵呵. HashMap为什么是不安全的? HashMap在put的时候,插入的元素超过了容量(由负载因子决定)的范围就会触发扩容操作,就是rehash,这个会重新将原数组的内容重新hash到新的