1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| HashMap<String,Integer> abc = new HashMap<String,Integer>();
abc.put("a", 0);
abc.put("b", 1);
abc.put("c", 2);
for(String temp:abc.keySet()) {
System.out.println(temp);
}
if(abc.containsKey("a")) {
System.out.println(abc.get("a"));
}
abc.clear();
System.out.println(abc.size());
|