public class Question {
public static void main(String argv[]) {
List a = new ArrayList();
a.add("a1");
a.add("a2");
a.add("a3");
Iterator it = a.iterator();
while (it.hasNext()) {
if (it.next().equals("a1")) {
a.remove("a1");
}
}
while (it.hasNext()) {
System.out.println(it.next());
}
}
}
estava fazendo um simulado aqui e vi essa questão que ate agora não consegui entender....