The listIterator() method of java.util.AbstractList class is used to return a list-iterator containing the same elements as that of the AbstractList in proper and same sequence starting from a specific position or index number which is passed as a parameter to this method.
ListIterator new_list = AbstractList.listIterator(int index);
Parameters: The parameter index is an integer type value that specifies the position of the element from where ListIterator starts operating and returning values.
Return Value: The method returns the list created using ListIterator, starting from the specified index.
Below program illustrate the AbstractList.listIterator() method:
AbstractList:[Geeks, for, Geeks, 10, 20] The list is as follows: Geeks 10 20
AbstractList:[10, 20, 30, 40, 50] The list is as follows: 30 40 50
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.