Java ListIterator previous() Method22 Mar 2025 | 2 min read The previous() method of ListIterator interface is used to return the previous element from the list and moves the cursor in a backward position. The above method can be used to iterate the list in a backward direction. SyntaxParametersNA ReturnThe above method is used to return the previous element of the given list. Throws:NoSuchElementException- If the given iteration has no such previous elements. Example 1Output: The list of alphabets is given as : [88, 67, 57] In the forward direction : 88 67 57 In the backward direction:- 57 67 88 Example 2Output:The list of electrical appliances is given as : [Fan, Tubelight, Bulb, Television] In the forward direction : Fan Tubelight Bulb Television In the backward direction:- Television Bulb Tubelight Fan Example 3Output: The list of alphabets is given as : [R, E, A, L] In the forward direction : R E A L In the backward direction:- L A E R 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