描述
The java.util.ArrayList.add(int index, E elemen) method inserts the specified element E at the specified position in this list.It shifts the element currently at that position (if any) and any subsequent elements to the right (will add one to their indices).
声明
Following is the declaration for java.util.ArrayList.add() method
public void add(int index, E element)
参数
index -- The index at which the specified element is to be inserted.
element -- The element to be inserted.
返回值
This method does not return any value.
异常
IndexOutOfBoundsException -- if the index is out of range.