Iterator<String> iter = list.iterator();
while (iter.hasNext()) {
String s = iter.next();
if (s.equals("要删除的元素")) {
iter.remove();
}
}
System.out.println(list);
while (iter.hasNext()) {
String s = iter.next();
if (s.equals("要删除的元素")) {
iter.remove();
}
}
System.out.println(list);