JSONObject json = new JSONObject();
json.put("name", "jacky");
json.put("age", 23);
json.put("time", System.currentTimeMillis());
String string = json.toString();
System.out.println(string);
Map<String, String> map = JSON.parseObject(string, new TypeReference<Map<String, String>>(){});
System.out.println(map);
{"name":"jacky","time":1563957295755,"age":23}
{name=jacky, time=1563957295755, age=23}
int和long都会转为String
网友评论