*/
public static void main(String[] args) {
// TODO Auto-generated method stub
MyHashMap
map.put("hello1", "world1");
map.put("hello2", "world2");
System.out.println(map);
Set
for (String string : set) {
System.out.println(string);
}
}
}
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
MyHashMap
map.put("hello1", "world1");
map.put("hello2", "world2");
System.out.println(map);
Set
for (String string : set) {
System.out.println(string);
}
}
}
有图有真相,总结:HashMap就是自定义索引的Set