Java Collections emptyIterator() MethodThe emptyIterator() method of Java Collections class is used to get an Iterator that has no elements. SyntaxFollowing is the declaration of emptyIterator() method: ParameterThis method does not accept any parameter. ReturnsThe emptyIterator() method returns an empty Iterator. ExceptionsNA Compatibility VersionJava 1.7 and above Example 1Test it NowOutput: Output: false Example 2Test it NowOutput: Iterator list is empty. Example 3Test it NowOutput: It is empty Iterator list.
Next TopicJava Collections Class
|