Create key-value pairs string in JSON

前端 未结 3 825
渐次进展
渐次进展 2020-12-19 20:53

I\'m new to JSON. I\'m trying to create a JSON string in Java (org.json.JSONObject(json.jar)) which resembles like (basically a set of name-value pairs)

[{
          


        
3条回答
  •  攒了一身酷
    2020-12-19 21:35

    What you've got there is a JSON array containing 4 JSON objects. Each object contains two keys and two values. In Java a JSON "object" is generally represented by some sort of "Map".

提交回复
热议问题