import java.util.*;
public class hashmap1 {
public static void main(String[] args) {
HashMap map = new HashMap();
map.put("a", "Apple");
map.put("b", "Boy");
map.put("c", "cat");
map.put("d", "Dog");
Set s = map.entrySet();
Iterator it = s.iterator();
while (it.hasNext()) {
System.out.println(it.next());
}
}
}
Output
d=Dog b=Boy c=cat a=AppleIf you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.