JAVA日报
2021-03-09 23:30
标签:function asn lis sys str each fun pre next public static void foreach(){ while(it.hasNext()){ JAVA日报 标签:function asn lis sys str each fun pre next 原文地址:https://www.cnblogs.com/mumulailai/p/14161559.htmlarraylist 遍历方法
public static void function(){
ArrayList
public static void foreach(){
ArrayList
name.add("????");
for (String string : name) {
System.out.println(string);
}
}
public static void useIterator(){
ArrayList
name.add("????");
Iterator
while(it.hasNext()){
System.out.println(it.next());
}
}
ArrayList
list.add(1);
ListIterator
System.out.println(it.next());
}
}