boolean add(E e) , void add(int index , E e)
插入元素,此方法有一个重载的方法(不明白重载和重写的区别,可点这里),可指定元素要插入的位置。
boolean addAll(Collection<? extends E> c)
,addAll(int index, Collection<? extends E> c)
插入一个集合,效果同上
void clear()
清除所有元素
boolean contains(Object o) , bolean containsAll
(Collection<?> c)
是否包含指定元素或集合
E get(int index)
返回指定位置的元素
int indexOf(Object o)
返回指定元素出现的位置,没有择返回 -1
iterator()
boolean retainAll(Collection<?> c)
在list中保留指定集合中包含的元素
E remove(int index),
boolean remove(Object o)