一道需要仔细看的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