I have following code-
import java.util.ArrayList; public class ArrayListExp{ public static void main (String[] args){ ArrayList
While removing elements you should not use for loop. It always make problems when implementing some logic. Use reverse for loop for your problem and always try to use for each.