What is the difference between iterators and listIterators? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

What is the difference between iterators and listIterators?

Iterators can iterate only in forward direction while listIterators can access in both directions

5th Jul 2016, 1:38 PM
Shipra Chordia
Shipra Chordia - avatar
5 Answers
+ 4
Iterator works only in forward direction while list iterators can move in both forward and backword direction. Iterator can be used just for read and remove purpose during loop execution. But list iterator can also be used for replacing element in list with new item as well as adding new element to the list during the loop execution
6th Jul 2016, 11:50 AM
taarak aggarwwal
taarak aggarwwal - avatar
+ 2
In single Word ITERATOR is used for COLLECTION (All Interface) and ListIterato is used only for LIST interface..
6th Nov 2016, 6:29 PM
Mukesh Kumaar
Mukesh Kumaar - avatar
+ 1
iterator is used in place of enumeration in collections
9th Nov 2016, 5:41 PM
deepak thakur
deepak thakur - avatar
0
Iterator is common for All Intefaces In collection.. And Iterator works only in forward direction while list iterators can move in both forward and backword direction... .... Iterator is used just for read and remove onjects during loop execution. ..... But list iterator can also be used for replacing element in list with new item as well as adding new element to the list during the code of execution or loop execution..... list Iterator is faster...
9th Nov 2016, 6:45 PM
Mukesh Kumaar
Mukesh Kumaar - avatar
0
Iterator Movement Is only Forward Direction,, we cab only Read and REMOVE,, ... ITS common for All collection.. LISTITERATOR only for List Objects,, It is Bidirectional,, We can READ/REMOVE/REPLACE/ADD
13th Nov 2016, 8:30 AM
Mukesh Kumaar
Mukesh Kumaar - avatar