HashMap和HashTable的区别

1.HashMap采用了数组+链表的数据结构,能在查询和修改方便继承了数组的线性查找和链表的寻址修改。

2.HashMap是非Synchronized,所以HashMap比HashTable更快。

3.HashMap可以接受null键和值,而Hashtable则不能(原因就是equlas()方法需要对象,因为HashMap是后出的API经过处理才可以)

posted @ 2020-12-08 16:46  乃颜先生  阅读(147)  评论(0)    收藏  举报