1.
indexOf:Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element. More formally, returns the lowest index
i
such that
(o==null ? get(i)==null : o.equals(get(i)))
, or -1 if there is no such
- 返回指定元素在列表中最后一次出现的位置下标,如果不含该元素,返回-1。
2.add:Appends the specified element to the end of this list (optional operation).
Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.
- 向列表指定位置插入指定ingtuan/manhuayuansu'>元素(可选操作)。
3.add(int 0,String a):Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
-
Parameters:
- index index at which the specified element is to be inserted
- element element to be inserted
- 向列表指定位置插入指定元素(可选操作)。
4.addAll:Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (Note that this will occur if the specified collection is this list, and it's nonempty.)
- 按指定集合的迭代其返回顺序,向列表末尾添加指定集合的所有元素(可选操作)。
5.addAll(0,c):Inserts all of the elements in the specified collection into this list at the specified position (optional operation).
- 向列表的指定位置插入指定集合的所有元素(可选操作)。