P E N C I L
Login
Iterable vs Iterator

Interface iterable { iterator() }

Iterator { next(), hasNext(), forEachRemaining()}

https://www.techiedelight.com/differences-between-iterator-and-iterable-in-java/

Loop

- For each works only on Iterable object

- Collection are iterable interface

- Iterator loop. for (var v : () -> iterator) or iterator.foreachreamining()

Design pattern Iterator:

- Goal: traverse a collection regardless of the datastructure of collection.