public static void main(String[] args) {
List list = new ArrayList();
list.add("1");
list.add("2");
list.add("3");
//遍历方式一
for(Iterator it = list.iterator();it.hasNext();){
String str = (String) it.next();
System.out.println(str);
while(its.hasNext()){
String str = (String) its.next();
System.out.println(str);
}
}
List list = new ArrayList();
list.add("1");
list.add("2");
list.add("3");
//遍历方式一
for(Iterator it = list.iterator();it.hasNext();){
String str = (String) it.next();
System.out.println(str);
}
//遍历方式二
while(its.hasNext()){
String str = (String) its.next();
System.out.println(str);
}
}