import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
public class PrintMapvalue {
public static void main(String[] args) {
HashMap<String, String> hmap = new HashMap<String, String>();
hmap.put("1000", "God");
hmap.put("2000", "Bless");
hmap.put("3000", "Govind");
Collection c = hmap.values();
Iterator itr = c.iterator();
while (itr.hasNext()) {
System.out.println(itr.next());
}
}
}
No comments:
Post a Comment