import java.util.HashMap;
import java.util.Map;
public class HashMapIteration1 {
public static void main(String[] args) {
//Creating HashMap;
HashMap<Integer, String> hm = new HashMap<>();
//Putting element
hm.put(1, "Naidu");
hm.put(3, "Rohilla");
hm.put(5, "Vijay");
hm.put(2, "Rahul");
hm.put(4, "Ramakesh");
hm.put(6, "Sudeep");
//Storing null value
hm.put(null, null);
System.out.println("Iterating HashMap Using For each loop");
for (Map.Entry<Integer, String> entry : hm.entrySet()) {
System.out.println("Key = "+entry.getKey()+" Value = "+entry.getValue());
}
}
}