import java.util.*;
class ArrayListDemo
{
public static void main(String[] args)
{
ArrayList al=new ArrayList();
al.add("java01");
al.add("java02");
al.add("java03");
al.add("java04");
// Iterator it=al.iterator();
ListIterator it=al.ListIterator();
while(it.hasNext()){
Object obj=it.next();
if(obj.equals("java02"))
it.remove();
sop(obj);
}
sop(al);
}
public static void sop(Object obj)
{
System.out.println(obj);
}
}
这段代码报错呢
|