import java.util.HashMap; 

 import java.util.Map; 



 public class map { 

public static void main(String[] args){ 

Map<Integer,String> map = new HashMap<Integer,String>(); 

method(map); 

} 

 

public static void method(Map<Integer,String> map){ 

//添加 

System.out.println(map.put(3, "lily")); 

System.out.println(map.put(3, "lisha")); 

map.put(5, "xiaoming"); 

map.put(7, "zhangsan"); 

System.out.println("map: "+map); 

//删除 

map.remove(5); 

System.out.println("remove_map: "+map); 

//判断 

System.out.println("containmap: "+map.containsKey(7)); 

//获取 

System.out.println("get_map: "+map.get(3)); 

} 

 }