list nodes= new ArrayLIst();
Iterator it = nodes.iterator();帮助文档上说:iterator()是返回以正确顺序在列表的元素上进行迭代的迭代器。
啥子意思哦?
多谢!

解决方案 »

  1.   

    用来遍历的
    迭代嘛,反正就next、next就遍历了一遍,或者previous、previous(listiterator)
      

  2.   

    也没什么特别的 用next方法 把集合中的对象一个个遍历出来
      

  3.   

    就是说用这个东西你能够把集合中的对象一个一个地拿出来。
    list nodes= new ArrayLIst();
    Iterator it = nodes.iterator();
    while(it.hasNext())
    {
        Object obj = (Object)it.next();
    }   //这里的Object就是你运行时想要的类型,也就是你放进去之前的类型哈。