标签:判断 span put bsp == 内容 empty str 关系
例如:
1 Map map = new HashMap<String ,String>(); 2 System.out.println("判断map是否有内容:"+map.isEmpty());//返回true 3 System.out.println("判断map是否为null:"+map==null);//返回false
1 Map map = new HashMap<String ,String>(); 2 map=null; 3 System.out.println("判断map是否为null:"+(map==null));//结果为true 4 System.out.println("判断map是否有内容:"+map.isEmpty());//NullPointerException
1 Map map = new HashMap<String ,String>(); 2 map.put(null,null); 3 System.out.println("判断map是否为null:"+(map==null));//false 4 System.out.println("判断map是否有内容:"+map.isEmpty());//false
标签:判断 span put bsp == 内容 empty str 关系
原文地址:http://www.cnblogs.com/zhima-hu/p/7615921.html