toJSONString() is undefined for the type JSONObject

前端 未结 4 1568
情歌与酒
情歌与酒 2021-01-02 15:21

My code to create a new JSONObject and write to a file:

JSONObject obj = new JSONObject();
obj.put(\"name\", \"abcd\");
obj.put(\"age\", new Integer(100));
J         


        
4条回答
  •  孤城傲影
    2021-01-02 16:07

    I meet the same question, if you want to use toJSONString() you need to import json-simple-1.1.jar library.

提交回复
热议问题