The List and Set collections provide iterators.
Tutorial Details:
The List and Set collections provide iterators, which are objects that allow going over all the elements of a collection in sequence. The java.util.Iterator interface provides for one-way traversal and java.util.ListIterator provides two-way traversal. Iterator is a replacement for the older Enumeration class which was used before collections were added to Java.
Creating an Iterator
Iterators are created by calling the iterator() or listIterator() method of a List, Set, or other data collection with iterators.
Rate Tutorial: http://www.roseindia.net/java/java-tips/data/collections/iterators.shtml
Read
Tutorial at: Click here to view the tutorial
Rate Tutorial: Iterators
View Tutorial: Iterators
Related
Tutorials:
|