fastjson Building, parsing json objects

maven dependence:

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>fastjson</artifactId>
    <version>1.2.66</version>
</dependency>
		//构建 json 对象
		JSONObject jsonObject = new JSONObject();
        jsonObject.put("market","SH");
        jsonObject.put("symbol","000001");
        jsonObject.put("price",1000);
        System.out.println(jsonObject.toJSONString());
        //解析 json 字符串
        JSONObject obj = JSONObject.parseObject(jsonObject.toJSONString());	
Published 41 original articles · won praise 0 · Views 792

Guess you like

Origin blog.csdn.net/weixin_37562241/article/details/104620770