public static void main(String[] args) { Map<String ,Object> map = new HashMap<>(); map.put("","wang"); map.put("f",null); map.put(null,"haha"); // map.put(null,null); System.out.println(map); }
结果为:{=wang, null=haha, f=null}