Map<String, Object> responseMap = new HashMap<String, Object>();
String userMessageId = responseMap.get("USER_MESSAGE_ID")+""; String userException = responseMap.get("USER_EXCEPTION_OBJECT")+""; System.out.println(null==(responseMap.get("USER_EXCEPTION_OBJECT"))); System.out.println(responseMap.get("USER_MESSAGE_ID")==null); System.out.println((userException).equals("null")); System.out.println(userException.equals(null));返回接口
true
true true false在map中取值为null ,转换成String的时候 null 变成了“null”
开发谨记