import java.util.ArrayList;
import java.util.Vector;
public class InsertOtherElements {
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList arrayList = new ArrayList();
arrayList.add("1");
arrayList.add("2");
arrayList.add("3");
//create a new Vector object
Vector v = new Vector();
v.add("4");
v.add("5");
arrayList.addAll(1,v);
for(int i=0; i<arrayList.size(); i++)
System.out.println(arrayList.get(i));
}
}
Console:
1
4
5
2
3