Java ListIterator hasPrevious() MethodThe hasPrevious() method of ListIterator interface is used to retrieve and remove the head of the deque. The method may differ by poll() method only in one case that it throws an exception if the given deque is empty. SyntaxParametersNA ReturnThe above method is used to return true if the given list iterator contains more number of elements during traversing the list in the reverse direction. Example 1Test it NowOutput: In actual order : 22 44 88 11 33 In reverse order : 33 11 88 44 22 Example 2Test it NowOutput: In actual order : N I T I N In reverse order : N I T I N Example 3Test it NowOutput: The given string in actual order : Java is a platform independent language The given string in reverse order : language independent platform a is Java Next TopicJava ListIterator |
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