What is the Iterable interface used for?
Besides what Jeremy said, its main benefit is that it has its own bit of syntactic sugar: the enhanced for-loop. If you have, say, an Iterable<String>, you can do: for (String str : myIterable) { … } Nice and easy, isn’t it? All the dirty work of creating the Iterator<String>, checking if it hasNext(), and … Read more