import java.util.Collections; import java.util.Iterator; public class EmptyIteratorExample { public static void main(String[] args) { IteratorIn the code example above, we import the Collections class and create an iterator using the emptyIterator() method. We then check if there are any elements in the iterator using the hasNext() method, which returns false as there are no elements. Package Library: java.utilitr = Collections.emptyIterator(); System.out.println(itr.hasNext()); // false } }