Return type of iterator() method in java

前端 未结 6 1506
耶瑟儿~
耶瑟儿~ 2021-01-03 07:46

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-

Iterat         


        
6条回答
  •  梦毁少年i
    2021-01-03 08:44

    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.

提交回复
热议问题