HashMap 键值对为null的情况
作者:互联网
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}
标签:map,HashMap,haha,键值,put,null,wang 来源: https://www.cnblogs.com/wangweiip/p/16529724.html