???????????д????????????Java?????????Щ????????????????????磺??????????????????????????С?Synchronizer??????CountDownLatch?????????????????????????
?????.?????????????????
??????Java?????????????У????????????List??Set??Queue??Map??
????List??Set??Queue?????????Collection????Map?????????????
???????Collection??Map??????????????List??Set??Queue??????Collection?????????????顢??????????????????????
??????ArrayList??LinkedList?????????List????HashSet?????Set??????Deque???????У?????????????β?????????????????????Queue????PriorityQueue?????Queue????????LinkedList????????????????????????Deque????
??????ArrayList??LinkedList??HashMap??Щ?????????????????
????????ж???????????????Щ????????????????
???????????д??????????????????????????κη??????Щ???????????????????????????????????Щ??????????????????
?????????Java??????????????????á?
??????.Java?е??????????
??????Java?У???????????????2??
????1??Vector??Stack??HashTable
????2??Collections??????????????????????????
????Vector?????List????Vector?????????????飬??ArrayList?????????Vector?е????????synchronized??????????????????????
????Stack?????????????????????????synchronized????????????????????????Vector??
????HashTable?????Map????????HashMap???????????HashTable????????????????HashMap??С?
????Collections??????????????????????Collection?????Collection???????????????Collections??????????????????????????????????????????????????????????????????????????????????????????????????????????????

??????.????????????
????????????????????????????????????е??????????synchronized???????????????????????????????????????????????????????????????????????????????????????????
??????????????????′????????????????????????????????????ArrayList??Vector?????
????1.????????
????????????????????????Vector??ArrayList????????????????????
public class Test {
public static void main(String[] args) throws InterruptedException {
ArrayList<Integer> list = new ArrayList<Integer>();
Vector<Integer> vector = new Vector<Integer>();
long start = System.currentTimeMillis();
for(int i=0;i<100000;i++)
list.add(i);
long end = System.currentTimeMillis();
System.out.println("ArrayList????100000?β???????????"+(end-start)+"ms");
start = System.currentTimeMillis();
for(int i=0;i<100000;i++)
vector.add(i);
end = System.currentTimeMillis();
System.out.println("Vector????100000?β???????????"+(end-start)+"ms");
}
}