Java
ArrayList, Vector
휘사마
2011. 11. 26. 20:21
1.ArrayList가 더 나중에 나왔다.
2.ArrayList는 thread-safe 하지 않고
Vector는 thread-safe 하다.
고로 동기화가 필요하지 않다면 ArrayList를 쓰는것이 성능이 더 좋다.
3.ArrayList도 thread-safe 하게 생성 가능하다.
List list = Collections.synchronizedList(new ArrayList(...));
4.다음이 모두 가능하다.
List list = new ArrayList()
List list = new Vector()