示例代码

1
2
3
4
Map<String,Object>  map = new HashMap<String, Object>();
map.put("1", "a");
map.put("2", "b");
map.put("3", "c");

判断键Key–containsKey

1
System.out.println(map.containsKey("1"));

判断value–containsValue

1
System.out.println(map.containsValue("b"));