Java tutorial
import java.util.ArrayList; public class Main { public static void main(String[] args) { ArrayList<Integer> arrlist = new ArrayList<Integer>(5); arrlist.add(15); arrlist.add(22); arrlist.add(30); arrlist.add(40); // adding element 25 at third position arrlist.add(2, 25); System.out.println(arrlist); } }