Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsEmptyIteratorExample2 { public static void main(String[] args) { List
ls = new ArrayList
(); ls.add("one"); ls.add("two"); ls.add("three"); ls.add("four"); Iterator
Itr = Collections.emptyIterator(); while(Itr.hasNext()){ System.out.println(Itr.next()); } System.out.println("Iterator list is empty."); } }
Output