Map<String, Object> map = new HashMap<>();
map.put("name", "huchengwei");
map.put("age", 21);
JSONObject jsonObject = new JSONObject(map);
String s = jsonObject.toJSONString();
String s1 = jsonObject.toString();
System.out.println("s==========" + s);
System.out.println("s1==========" + s1);
JSONObject jsonObject1 = JSONObject.parseObject(s);
Object name = jsonObject1.get("name");
System.out.println("name=====" + name);
报错:com.alibaba.fastjson.JSONException: expect ':' at 0, actual =
最新推荐文章于 2022-06-09 10:30:32 发布