ArrayList
- 기존의 Vector를 개선한 것으로 구현원리와 기능적으로 동일
- ArrayList와 달리 Vector는 자체적으로 동기화처리 되어 있다.
- List인터페이스를 구현하므로, 저장순서가 유지되고 중복을 허용
- 데이터의 저장공간으로 배열을 사용(배열기반)
| 1 | public class Vector extends AbstractList implements List, RandomAccess, Cloneable, java.io.Serializeable { | 
| 2 |   protected Object[] elementData; //객체를 담기 위한 배열 | 
| 3 | } | 
- 생성자- ArrayList() //생성자
- ArrayList(Collection c) //컬렉션들끼리 변환할때사용
- ArrayList(int initalCapacity) //배열의길이
 
- 추가- boolean add(Object o)
- void add(int index, Object element)
- boolean addAll(Collenction c)
- boolean addAll(int index, Collection)
 
- 삭제- booelean remove(Object o)
- Object remove(int index)
- boolean remove(Collenction c)
- void clear() //모든객체삭제
 
- 검색- int indexOf(Object o)
- int lastIndexOf(Object o)
- boolean contains(Object o) //객체가존재하는지
- Object get(int index) //객체읽기
- Object set(int index, Object element) //객체변경
 
- 새로운 리스트를 만듦- List subList(int fromindex, toindex) //from~to 새로운 리스트를 만듦
- Object[] toArray() //ArrayList의 객체배열를 리스트반환
- Object[] toArray(Object[] a)
- boolean isEmpty() //비어있는지확인
- void trimToSize() //빈공간제거
- int size() //객체갯수반환
 
ArrayList에 저장된 객체의 삭제과정
- 삭제할 데이터 아래의 데이터를 한 칸씩 위로 복사해서 삭제할 데이터를 덮어씀 - System.arraycopy(data, 3, data, 2, 2) //data[3]에서 data[2]로 2개의 데이터를 복사하라는 의미 <!--1-->
 
- 데이터가 삭제되어 데이터의 개수가 줄었으므로 size의 값을 감소 - size--; <!--2-->
 
- ArryaList에 저장된 마지막 객체부터 삭제하는 경우(배열 복사 발생안함) - for (int i=list.size(); i>0; i--){ list.remove(i); }