EMZETT.
Login

Iterate

In short: Iterating means going through all elements of a collection one after another.

In more detail: There are loops and iterators for this.

In Depth

for (int i = 0; i < list.size(); i++) { ... }   // classic
for (String s : list) { ... }                    // for-each
list.forEach(System.out::println);                // stream/lambda

The iterator additionally allows safe removal while iterating. Changing the list inside a for-each loop leads to a ConcurrentModificationException. See iterator concept.

See also: Iterator, Iterator