删除ArrayList中某个元素

ArrayList list3 = new ArrayList(Arrays.asList("a", "b", "c", "d"));
        Iterator iterator = list3.iterator();
        while (iterator.hasNext()){
            String s=iterator.next();
            if(s.equals("c")){
                iterator.remove();
            }
        }

 

你可能感兴趣的:(java)