首页 > 其他分享 >JSON

JSON

时间:2023-02-10 12:34:54浏览次数:36  
标签:12 name jsonObject JSON JSONObject put class

JSONObject

JSONObject jsonObject = new JSONObject();
jsonObject.put("id", null);
jsonObject.put("class", "12");
jsonObject.put("name", "");
// 使用默认序列化方式打印{"name":"","class":"12"}
System.out.println(jsonObject.toJSONString());
// 使用指定序列化方式  {"id":null,"name":"","class":"12"}
System.out.println(jsonObject.toJSONString(jsonObject, SerializerFeature.WriteMapNullValue));

标签:12,name,jsonObject,JSON,JSONObject,put,class
From: https://www.cnblogs.com/haveanicedayfh/p/17108481.html

相关文章