//将Map的所有key都查出来并转为List:
HashMap<String, Integer> map = new HashMap<>();
map.put("1",1);
map.put("2",2);
map.put("3",3);
map.put("4",4);
List<String> keyList = new ArrayList<>(map.keySet());
//判断Map的key,是否包含,返回布尔值:
boolean b = map.containsKey("1");
//将Map的所有key都查出来并转为List:
HashMap<String, Integer> map = new HashMap<>();
map.put("1",1);
map.put("2",2);
map.put("3",3);
map.put("4",4);
List<String> keyList = new ArrayList<>(map.keySet());
//判断Map的key,是否包含,返回布尔值:
boolean b = map.containsKey("1");