for(int i = 0; i < 13; i++){ arr.add(0, arr.get(12)); //String d = arr.get(12); //arr.remove(12); //arr.add(0, d); } ......>>>> in above lines of code i used first statement inside loop and result was as per requirement......replacing of first element with the last. then why add some extra lines( three commented statements inside loop above) to remove last element ?