What is "List Iterator" in Java? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is "List Iterator" in Java?

12th Oct 2019, 8:09 AM
Ogheneochuko Godstime Avwenagbiku
Ogheneochuko Godstime Avwenagbiku - avatar
2 Answers
+ 1
I recommend using the oracle documentation. Very well described. https://docs.oracle.com/javase/7/docs/api/java/util/ListIterator.html I hope it will help :)
12th Oct 2019, 10:25 AM
Daniel (kabura)
Daniel (kabura) - avatar
+ 1
Iterator is an object that remember a position in a sequence of elements, and it's methods can get next element or has access to these elements ListIterator is the interface for iterators in List implementations. ArrayList<Integer> arr = new ArrayList<>(List.of(1,2,3,4,5)); ListIterator<Integer> it = arr.listIterator(); do System.out.print(it.next() ); //12345 while(it.hasNext() );
12th Oct 2019, 8:09 PM
zemiak