public static void main(String[] args) {
Map<String, Long> map = new HashMap<String, Long>();
Long v1 = 12345678L;
Long v2 = 87654321L;
map.put("v1",v1);
map.put("v2",v2);
Iterator it = map.keySet().iterator();
System.out.println("删除前:");
while(it.hasNext()){
String key = it.next().toString();
Long val = map.get(key);
System.out.println(val);
}
map.remove("v1");
Iterator itr = map.keySet().iterator();
System.out.println("\n删除后:");
while(itr.hasNext()){
String key = itr.next().toString();
Long val = map.get(key);
System.out.println(val);
}
}
Map<String, Long> map = new HashMap<String, Long>();
Long v1 = 12345678L;
Long v2 = 87654321L;
map.put("v1",v1);
map.put("v2",v2);
Iterator it = map.keySet().iterator();
System.out.println("删除前:");
while(it.hasNext()){
String key = it.next().toString();
Long val = map.get(key);
System.out.println(val);
}
map.remove("v1");
Iterator itr = map.keySet().iterator();
System.out.println("\n删除后:");
while(itr.hasNext()){
String key = itr.next().toString();
Long val = map.get(key);
System.out.println(val);
}
}