83
Java Collections emptyIterator() Method
The emptyIterator() method of Java Collections class is used to get an Iterator that has no elements.
Syntax
Following is the declaration of emptyIterator() method:
Parameter
This method does not accept any parameter.
Returns
The emptyIterator() method returns an empty Iterator.
Exceptions
NA
Compatibility Version
Java 1.7 and above
Example 1
Output:
Output: false
Example 2
Output:
Iterator list is empty.
Example 3
Output:
It is empty Iterator list.
Next TopicJava Collections Class