Question: why iterator is used in java?
Answer: In Java, Iterator is an interface available in Collection framework in java. ... It is a Java Cursor used to iterate a collection of objects. It is used to traverse a collection object elements one by one. It is available since Java 1.2 Collection Framework.