ConcurrentMap和HashMap的区别

ConcurrentMap和HashMap的区别说的具体点 谢谢

1。hashMap可以有null的键,concurrentMap不可以有
2。hashMap是线程不安全的,在多线程的时候需要Collections.synchronizedMap(hashMap),ConcurrentMap使用了重入锁保证线程安全。
3。在删除元素时候,两者的算法不一样。
http://sinly.iteye.com/admin/blogs/1270748
http://sinly.iteye.com/admin/blogs/1264762

[quote]ConcurrentMap
提供其他原子 putIfAbsent、remove、replace 方法的 Map。[/quote]

它扩展了Map接口,比HashMap多了几个原子操作的方法

ConcurrentMap 是线程安全的,而hashMap不是线程安全的,ConcurrentMap的操作都是原子操作,hashMap不是啊!