Java_16 map转json字符串


目录
  • map转json字符串

map转json字符串


   com.alibaba
   fastjson
   1.2.24


Map resultMap = new HashMap<>();
resultMap.put("type", type);
resultMap.put("id", 10);
resultMap.put("name", "name");
JSONArray jArray = new JSONArray();
jArray.add(resultMap);
String str = jArray.toString();