O'Reilly logo

JavaBeans Unleashed by Rick Leinecker, Dr. Donald Doherty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Iterating Through Collections

The Collections Framework includes two interfaces, the java.util.Iterator and java.util.ListIterator interfaces, which you implement in classes that step through collections of objects one at a time. An object that implements one of these interfaces generates a series of objects, one at a time, as successive calls to the next() method return successive objects in a collection.

Write classes that implement the java.util.Iterator interface to iterate over collections of objects represented by objects implementing the java.util.Collection interface. When you want to iterate over lists, write classes that implement the java.util.ListIterator interface, which extends the java.util.Iterator interface. This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required