Home » Java ListIterator hasNext() Method with Examples

Java ListIterator hasNext() Method with Examples

by Online Tutorials Library

Java ListIterator hasNext() Method

The hasNext() method of ListIterator interface is used to return true if the given list iterator contains more number of element during traversing the given list in the forward direction.

Syntax

Parameters

NA

Specified by:

hasNext in interface Iterator<E>

Return

The above method is used to return true if the given list iterator contains more number of element during traversing the given list in the forward direction.

Example 1

Test it Now

Output:

The final list for long value is given as:   66  70  21  

Example 2

Test it Now

Output:

The final list for the characters is given as:   a  e  i  o  u  

Example 3

Test it Now

Output:

The final list for integer value is given as:   22  44  88  11  33  

You may also like