Iterable
were introduced to use in for each loop in java
public interface Collection<E> extends Iterable<E>
Iterator
is class that manages iteration over an Iterable
. It maintains a state of where we are in the current iteration, and knows what the next element is and how to get it.