Suppose I have an ArrayList of objects of size n. Now I want to insert an another object at specific position, let\'s say at index position k (is greater than 0 and less tha
Here is the simple arraylist example for insertion at specific index
ArrayList str=new ArrayList(); str.add(0); str.add(1); str.add(2); str.add(3); //Result = [0, 1, 2, 3] str.add(1, 11); str.add(2, 12); //Result = [0, 11, 12, 1, 2, 3]