An iterator performs traversal and also gives access to data elements in a container, but does not itself perform iteration (i.e., not without some significant liberty taken with that concept or with trivial use of the terminology) citation needed.However, because of the rich set of methods available in the Scala collections library, such as map, collect, filter etc., it is often not necessary to deal with iterators directly when programming in Scala.

After you increment any copy of an input iterator, none of the other copies can safely be compared, dereferenced, or incremented thereafter.An exception is also thrown if there are no more elements remaining (hasNext has previously returned false).For more information, see Checked Iterators and Debug Iterator Support.

A b Watt, Stephen.This method can be called only once per call to next.