Iterator and Iterable
suggest changeVersions
Iterator has been in Java SE since 1.2. Iterable was added in Java 5. The original version list ran from Java SE 1.2 through Java SE 9 Early Access.
Introduction
java.util.Iterator is the standard Java SE interface for objects that implement the Iterator design pattern. java.lang.Iterable is for objects that can provide an iterator.
Remarks
It is possible to iterate over an array using the for-each loop, though Java arrays do not implement Iterable. The compiler turns that loop into an index loop.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents