What are the benefits of the Iterator interface in Java?

后端 未结 16 1927
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 14:35

I just learned about how the Java Collections Framework implements data structures in linked lists. From what I understand, Iterators are a way of traversing th

16条回答
  •  Happy的楠姐
    2020-12-04 15:18

    Iterator is useful when you are dealing with Collections in Java.

    Use For-Each loop(Java1.5) for iterating over a collection or array or list.

提交回复
热议问题