package itcast;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
public class Test {
public static void sop(Object obj) {
System.out.println(obj);
}
public static void main(String[] args)
{
ArrayList al = new ArrayList();
al.add("1");
al.add("2");
al.add("3");
al.add("4");
Iterator it= al.iterator();
while(it.hasNext());
{
sop("next:"+it.next());
}
}
}
编译能通过,但是没结果,这是什么情况,纠结了半小时了
|
|