public static void main(String[] args) {
ArrayList<String> arr = new ArrayList();
arr.add("a");
arr.add("b");
System.out.println(arr);
ListIterator<String> it = arr.listIterator();
while (it.hasNext()) {
if ("a".equals(it.next()))
it.remove();
}
System.err.println(arr);
}
|