iterator for replacing list members in Java?

后端 未结 3 1903
囚心锁ツ
囚心锁ツ 2021-01-07 16:34

Hmmm... the Java Iterator has a remove() method but not a replace(T replacement) method.

Is there an efficient way to

3条回答
  •  悲&欢浪女
    2021-01-07 16:47

    ListIterator.set as returned by List.listIterator() or List.listIterator(int)

    (set wouldn't make any sense for, say, a Set iterator.)

提交回复
热议问题