Iterator 和 ListIterator 对比

Iterator 的方法

    
  //是否还有下一个
  boolean hasNext();   //返回下一个 E next();   //移除返回的下一个 void remove();

ListIterator 的方法    红色的三个方法是ListIterator  继承  Iterator 

    boolean hasNext();   

  E next();

    boolean hasPrevious();

    E previous();

    int nextIndex();

    int previousIndex();

    void remove();

    //设置当前的对象
    void set(E var1);

  //从当前的位置添加一个对象
    void add(E var1);

 所以  ListIterator 比 Iterator 多了  添加 ,更新,前一个对象等功能

原文地址:https://www.cnblogs.com/alway-july/p/7586823.html