Collections.emptyListIterator() in Java

Collections.emptyListIterator(): This method is available in java.util.Collections class of Java.

Syntax:

<Object> ListIterator<Object> java.util.Collections.emptyListIterator()

This method returns a list iterator that has no elements.

Parameters: NA

Returns: an empty list iterator.

Exceptions: NA

Approach

Java

import java.util.Collections;

public class CollectionsemptyListIterator {
    public static void main(String[] args) {

        System.out.println(Collections.emptyListIterator());

    }
}

Output:

java.util.Collections$EmptyListIterator@26f0a63f


No comments:

Post a Comment