Skip to content

Commit eba95e7

Browse files
committed
优化“HashMap和Hashtable的区别”一文
1 parent b625c3d commit eba95e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contents/differences-between-hashmap-and-hashtable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
2. `Hashtable`不允许有空的键或值。`HashMap`允许空键和空值。
99
3. HashMap有一个子类[LinkedHashMap](http://docs.oracle.com/javase/7/docs/api/java/util/LinkedHashMap.html),对这个类对象进行迭代时,它的顺序是有序的(按插入顺序排序)。如有需要,你也能轻易的从`LinkedHashMap`转化成`HashMap``Hashtable`就没那么简单了,
1010

11-
总之,如果你无需关心同步(synchronized)问题,我会建议用`HashMap`。反之,你可以参考[ConcurrentHashMap](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html)
11+
总之,如果你无需关心同步(synchronized)问题,我会建议用`HashMap`。反之,你可以考虑使用[ConcurrentHashMap](http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html)
1212

1313
### stackoverflow链接:
1414
http://stackoverflow.com/questions/40471/differences-between-hashmap-and-hashtable

0 commit comments

Comments
 (0)