Add an element to specified index of Java ArrayList
import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<String> arrayList = new ArrayList<String>(); arrayList.add("1"); arrayList.add("2"); arrayList.add("3"); arrayList.add(1, "INSERTED"); for (String str: arrayList) System.out.println(str); } } /* 1 INSERTED 2 3 */