Kaspi Bank interview question

What is an Iterator?

Interview Answer

Anonymous

23 Nov 2016

The Iterator interface provides a number of methods that are able to iterate over any Collection. Each Java Collection contains the iterator method that returns an Iterator instance. Iterators are capable of removing elements from the underlying collection during the iteration.