Java ListIterator previousIndex() Method22 Mar 2025 | 2 min read The previousIndex() method of ListIterator interface is used to return the index of the given element which is returned by a call to previous. The method may return -1 if and only if the iterator is placed at the beginning of the list. SyntaxParametersNA ReturnThe above method is used to return the index of the given element which is returned by a call to previous. The method may return -1 if and only if the iterator is placed at the beginning of the list. Example 1Output: The letters are listed as : [R, E, A, L] The Previous Index is : -1 The Previous Index is : 0 The Next Index is : 1 The Next index is : 2 Example 2Output: The numbers are listed as : [34, 78, 57] The Previous Index is : -1 The Previous Index is : 0 The Next Index is : 1 Next TopicJava ListIterator |
We request you to subscribe our newsletter for upcoming updates.

We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India