1
0
mirror of https://github.com/Snailclimb/JavaGuide synced 2025-06-16 18:10:13 +08:00

Update Java集合框架常见面试题总结.md

This commit is contained in:
Snailclimb 2018-08-10 06:05:16 +08:00 committed by GitHub
parent dd87552850
commit 43ff4fa72c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,10 +1,10 @@
[ListSet,Map三者的区别及总结](#ListSet,Map三者的区别及总结)
[Arraylist与LinkedList 区别](#Arraylist与LinkedList 区别)
[Arraylist与LinkedList区别](#Arraylist与LinkedList区别)
[ArrayList与Vector区别](#ArrayList与Vector区别)
[HashMap和Hashtable 的区别](#HashMap和Hashtable 的区别)
[HashMap和Hashtable的区别](#HashMap和Hashtable的区别)
## <font face="楷体">ListSet,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基本被淘汰。