接口Conllection的API方法
方法名
|
作用
|
boolean add(E e)
|
添加一个元素
|
boolean addAll(Collection<? extends E> c)
|
添加一组元素
|
void clear()
|
清空集合
|
boolean contains(Object o)
|
判断包含一个元素
|
boolean contains(Collection<? > c)
|
判断包含一组元素
|
boolean isEmpty()
|
判断集合是否有元素
|
Iterator<E> iterator()
|
返回集合的迭代器
|
boolean remove(Object o)
|
删除一个元素
|
boolean removeAll(Collection<?> c)
|
删除传入集合中共有的元素
|
boolean retainAll(Collection<?> c)
|
保留传入集合中共有的元素
|
Object[] toArray()
|
将集合返回Object数组
|