I am a new-comer in Java and in process of learning.
I need a an answer of following question supported with valid theory.
Consider the following line-
Iterator is generic and doesn't return a specific type unless you define it in the ArrayList. Iterator is an interface (part of the Java Collections) that returns the type that was passed to it. The Iterator is used to traverse the list of elements, and remove an element if necessary.