why there is no add method in Iterator interface

前端 未结 6 1603
逝去的感伤
逝去的感伤 2021-02-01 06:05

In Iterator Sun added the remove method to remove the last accessed element of the collection. Why there is no add method to add a new element to the collection? Wh

6条回答
  •  一向
    一向 (楼主)
    2021-02-01 06:59

    If you are working on a list you could use ListIterator which provides both add and remove operations.

提交回复
热议问题