arraylist add at start code example
Example: java append to arraylist at beginning
ArrayList<Integer> arr = new ArrayList<Integer>();
arr.add(1);
arr.add(2);
arr.add(3);
arr.add(4);
int element = 0;
//ArrayList.add(index, element)
arr.add(0, element);