public interface Iterator
An iterator over a collection. Iterator takes the place of Enumeration in the Java collections framework. Iterators differ from enumerations in two ways: Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics.
Method names have been improved.
Since:
1.2
See Also:
Collection, ListIterator, Enumeration
An iterator over a collection. Iterator takes the place of Enumeration in the Java collections framework. Iterators differ from enumerations in two ways: Iterators allow the caller to remove elements from the underlying collection during the iteration with well-defined semantics.
Method names have been improved.
Since:
1.2
See Also:
Collection, ListIterator, Enumeration
为什么用iterator()来遍历数据元素啊,直接用(比如ArrayList)ArrayList.get(index)不就行了?
请看。
http://www.onjava.com/lpt/a//onjava/2001/10/23/optimization.html
Iterator is designed for searching elements of Collection's classes.
Set has no index. You have to use iterator to get the elements.Suggestion, Don't try to translate the all terms to Chinese words. try to understand the purposes and behaviors of the terms. Sometime you cannot find an right Chinese words for them.