Java HashSet Iterate Through Keys
Chapter:
Collections
Last Updated:
15-05-2016 16:04:17 UTC
Program:
/* ............... START ............... */
import java.util.Hashtable;
import java.util.Enumeration;
public class JavaHashTableIterateThroughKey {
public static void main(String[] args) {
Hashtable hashTable = new Hashtable();
hashTable.put("1", "One");
hashTable.put("2", "Two");
hashTable.put("3", "Three");
Enumeration enumeration = hashTable.keys();
while (enumeration.hasMoreElements())
System.out.println(enumeration.nextElement());
}
}
/* ............... END ............... */
Output
Tags
Collection,HashSet Iterate Through Keys, Java