import java.util.*;
public class hashmap {
public static void main(String[] args) {
HashMap hash = new HashMap();
hash.put("roll", new Integer(12));
hash.put("name", "jack");
hash.put("age", 22);
Set s = hash.entrySet();
Iterator i = s.iterator();
while (i.hasNext()) {
System.out.println(i.next());
}
}
}
Output
roll=12 age=22 name=jackIf 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.