Please enter your email address or userHandle.
import java.util.*; public class IteratorDemo { public static void main(String args[]) { //create a Hashset to store strings HashSet<String> hs = new HashSet<String>() ; // store some string elements hs.add("India"); hs.add ("America"); hs.add("Japan"); // Add an Iterator to hs. Listlterator it = hs.listlterator(); // Display element by element using Iterator System.out.println( "Elements using Iterator: "); while (it.hasNext()) System.out.println(it.next()); } }
https://ide.geeksforgeeks.org/juZ1EE
No Output