A:添加功能
boolean add(Object obj):向集合中添加一个元素
boolean addAll(Collection c):向集合中添加一个集合的元素。
B:删除功能
void clear():删除集合中的所有元素。
boolean remove(Object obj):从集合中删除指定的元素
boolean removeAll(Collection c):从集合中删除一个指定的集合元素。
C:判断功能
boolean isEmpty():判断集合是否为空。
boolean contains(Object obj):判断集合中是否存在指定的元素。
boolean containsAll(Collection c):判断集合中是否存在指定的一个集合中的元素。
D:遍历功能
Iterator iterator():就是用来获取集合中每一个元素。
E:长度功能
int size():获取集合中的元素个数
F:交集功能
boolean retainAll(Collection c):判断两个集合中是否有相同的元素。???
G:把集合转换成数组
Object[] toArray():把集合变成数组 |
|