美文网首页
用迭代器遍历List

用迭代器遍历List

作者: 路太弯爱在转0204 | 来源:发表于2017-03-30 20:19 被阅读0次

    迭代器依赖集合存在

    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