62,615
社区成员
发帖
与我相关
我的任务
分享
import java.util.*;
class MapTest{
public static void main(String[] args){
HashMap hm=new HashMap();
hm.put("one","aaa");
hm.put("two","bbb");
hm.put("three","ccc");
hm.put("four","ddd");
hm.remove("three");
hm.put("five","eee");
Set set=hm.entrySet();
Iterator it=set.iterator();
while(it.hasNext()){
Map.Entry me=(Map.Entry)it.next();
System.out.println(me.getKey()+":"+me.getValue()+":"+me.hashCode());
}
}
}
HashMap hp = new HashMap();
hp.put("1", "2");
System.out.println(hp.keySet());