一道需要仔细看的java面试题

 public static void main(String[] args) {
    	Map<String, Object> resultMap = new HashMap<String, Object>();
    	String str = MapUtil.getStr(resultMap, "yyyy");
    	System.out.println("++"+str);
    	System.out.println("++"+str instanceof String);
    	System.out.println("++"+str == null);
    	System.out.println("++"+"null".equals(str));
}

 

 

 

 

 

 

 

 

 

 

 

 

结果是:

++null
true
false
++false

  

posted on 2024-05-14 11:27  qqq9527  阅读(4)  评论(0编辑  收藏  举报

导航