首页 > 学院 > 开发设计 > 正文

ListIterator-迭代器

2019-11-14 15:08:06
字体:
来源:转载
供稿:网友

  Iterable(lang)-->Iterator(util)-->ListIterator(util)

  method: 1.void add(E o)

       2.boolean hasNext()    //正向遍历

         3.boolean hasprvious()  //反向遍历

       4.E next()

       5.int nextIndex()

        6.E PRevious()

        7.int priviousIndex()

        8.void remove()

        9.void set(E o) //指定元素替换使用 4或6 返回的元素。使用时,必须调用了4或6,

                并且在该方法之前不能出现remove和add方法。


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表