1//The add(int index, E element) method of Java ArrayList class
2//inserts a specific element in a specific index of ArrayList.
3//It shifts the element of indicated
4//index if exist and subsequent elements to the right.
5List<String> colors = new ArrayList<>();
6colors.add("red"); // ["red"]
7colors.add("blue"); // ["red" , "blue"]
8colors.add(1, "white"); // ["red" , "white", "blue"]
9colors.add(0, "black"); // ["black", "red" , "white", "blue"]