Collections
[자바스터디] Collection - Collections
Collections Arrays와 동일하게 Collection에 관련된 메서드를 제공하는 클래스 1. Collection의 동기화 멀티 쓰레드 프로그래밍을 하게 되면, 하나의 객체를 여러 쓰레드가 동시 접근이 가능하다. 따라서 데이터의 일관성을 위해 동기화가 필요하다. List list = Collections.synchronizedList(new ArrayList(Arrays.asList(1,2,3))); 2.Unmodified 컬렉션 데이터 일관성을 위해 동기화를 했지만, 만약 데이터를 번경하지 않게 하기 위해서는 해당 메서드를 이용한다. List list = Collections.unmodifiableList(new ArrayList(Arrays.asList(1,2,3))); 3. 하나의 종류만 ..