import java.util.ArrayList; import java.util.List; public class Test { public static void main(String[] args) { List l = new ArrayList(); l.add(new Integer(1)); l.add(new Integer(2)); for (Integer i : l) { if (i.equals(2)) { l.remove(i); } } } }