迭代器依赖集合存在
List Course = new ArrayList();
Iterator it = Object.iterator();
while(it.hasNext()){
Course cr = (Course)it.next();
}
for(Object obj : courseToSelect){
Course cr = (Course)it.next();
}
迭代器依赖集合存在
List Course = new ArrayList();
Iterator it = Object.iterator();
while(it.hasNext()){
Course cr = (Course)it.next();
}
for(Object obj : courseToSelect){
Course cr = (Course)it.next();
}
本文标题:用迭代器遍历List
本文链接:https://www.haomeiwen.com/subject/jivpottx.html
网友评论