Package java.util
Class ArrayList

Public Method add

void add(int index, Object element)

Overrides:

Throws:

boolean add(Object element)

Overrides:

_INSERT_METHOD_SIGNATURE_HERE_

Description:

add(int index, Object element) method:

Inserts the specified element at the specified position in this list. Shifts the element currently at that position if any and any subsequent elements to the right.

add(Object element) method:

Inserts the specified element at the specified position in this list. Shifts the element currently at that position if any and any subsequent elements to the right.

Example

   String element = "This is the second element!";
   ArrayList aList = new ArrayList(10);
   aList.add(element);

The example above adds a string element to the ArrayList.