描述
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.