Take a look at the API: ArrayList (Java Platform SE 6)

public void add(int index, E element)
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >...