1. loss of effect
public static void main(String[] args) {
User user = new User();
Map<String, Object> reMap = new HashMap<String, Object>();
reMap.put("aaa",null);
reMap.put("bbb",user);
String json = JSONObject.toJSONString(reMap);
System.out.println(json);
}
2.不丢失效果(SerializerFeature.WriteMapNullValue)(SerializerFeature.WRITE_MAP_NULL_FEATURES)
public static void main(String[] args) {
User user = new User();
Map<String, Object> reMap = new HashMap<String, Object>();
reMap.put("aaa",null);
reMap.put("bbb",user);
String json = JSONObject.toJSONString(reMap,SerializerFeature.WriteMapNullValue);
String json1 = JSONObject.toJSONString(reMap,SerializerFeature.WRITE_MAP_NULL_FEATURES);
System.out.println("json:"+json);
System.out.println("json1:"+json1);
}