mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
Update Java集合框架常见面试题总结.md
This commit is contained in:
parent
dd87552850
commit
43ff4fa72c
@ -1,10 +1,10 @@
|
||||
[List,Set,Map三者的区别及总结](#List,Set,Map三者的区别及总结)
|
||||
|
||||
[Arraylist与LinkedList 区别](#Arraylist与LinkedList 区别)
|
||||
[Arraylist与LinkedList区别](#Arraylist与LinkedList区别)
|
||||
|
||||
[ArrayList与Vector区别](#ArrayList与Vector区别)
|
||||
|
||||
[HashMap和Hashtable 的区别](#HashMap和Hashtable 的区别)
|
||||
[HashMap和Hashtable的区别](#HashMap和Hashtable的区别)
|
||||
|
||||
## <font face="楷体">List,Set,Map三者的区别及总结</font>
|
||||
- **List:对付顺序的好帮手**
|
||||
@ -26,7 +26,7 @@ Arraylist底层使用的是数组(存读数据效率高,插入删除特定
|
||||
Vector类的所有方法都是同步的。可以由两个线程安全地访问一个Vector对象、但是一个线程访问Vector
|
||||
,代码要在同步操作上耗费大量的时间。Arraylist不是同步的,所以在不需要同步时建议使用Arraylist。
|
||||
|
||||
## <font face="楷体">HashMap和Hashtable 的区别</font>
|
||||
## <font face="楷体">HashMap和Hashtable的区别</font>
|
||||
1. HashMap是非线程安全的,HashTable是线程安全的;HashTable内部的方法基本都经过synchronized修饰。
|
||||
|
||||
2. 因为线程安全的问题,HashMap要比HashTable效率高一点,HashTable基本被淘汰。
|
||||
|
Loading…
x
Reference in New Issue
Block a user