JDK8源码阅读笔记--------java.util.List

List是一个有序集合,元素可以重复,是一个接口,继承Collections接口

1.int size();

2.boolean isEmpty();

3.boolean contains(Object o);

4.Iterator<E> iterator();

Returns an iterator over the elements in this list in proper sequence

以适当的顺序返回列表中元素的迭代器。

5.Object[] toArray();

6.boolean add(E e);

7.boolean remove(Object o);

8.boolean containsAll(Collection<?> c);

9.boolean addAll(Collection<? extends E> c);

10.boolean addAll(int index, Collection<? extends E> c);

11.boolean removeAll(Collection<?> c);

12.boolean retainAll(Collection<?> c);

只保留此列表中指定集合中包含的元素(可选操作)。换句话说,从该列表中删除指定集合中不包含的所有元素。

13.void clear();

14.E get(int index);

15.E set(int index, E element);

16.void add(int index, E element);

17.E remove(int index);

18.int indexOf(Object o);

19.int lastIndexOf(Object o);

20.ListIterator<E> listIterator();

猜你喜欢

转载自blog.csdn.net/weixin_39035120/article/details/84586445