title: How to pass list of objects in json object
body: <p>Hi I am developing small application in which I am trying to pass some data in http post method. So I want to send my data like this form </p>
  
  <pre><code>"storeid": "151",
      "floordata": {
      "entry": [
          10,
          15
      ],
      "exit": [
          10,
          15
      ],
  
      "section": [
          {
              "id": "0",
              "sectionname": "ABC",
              "category": "office",
             "boundary": [
                  [
                      85,
                      258
                  ],
                  [
                      85,
                      298
                  ],
                  [
                      125,
                      298
                  ],
                  [
                      125,
                      258
                  ],
                  [
                      85,
                      258
                  ]
              "description": "Mobile based company"
          }
      ]
      },
      "category": null,
      "description": null
  </code></pre>
  
  <p>so my problem is regarding section parameter. I am doing this for section parameter.</p>
  
  <pre><code>        String section = "section=";
  
          // Problem for me is here ... 
          JSONArray sections = new JSONArray();
  
          List&lt;List&lt;Float&gt;&gt; sectionCords = new ArrayList&lt;List&lt;Float&gt;&gt;();
          List&lt;Float&gt; sectionCordData = new ArrayList&lt;Float&gt;();
          sectionCordData.add(0.0f);
          sectionCordData.add(0.1f);
  
          List&lt;Float&gt; sectionCordData1 = new ArrayList&lt;Float&gt;();
          sectionCordData1.add(0.0f);
          sectionCordData1.add(0.1f);
  
          sectionCords.add(sectionCordData);
          sectionCords.add(sectionCordData1);
  
          JSONObject sectionObj = new JSONObject();
          //List&lt;JSONObject&gt; cordList = new ArrayList&lt;JSONObject&gt;();
  
          try {
              sectionObj.put("category", "office");
              sectionObj.put("description", "Mobile based company");
              sectionObj.put("sectionname", "mobiotics");
              sectionObj.put("id", 0);
              sectionObj.put("boundary", sectionCords); // Check Here i am sending as list ...
  
          } catch (JSONException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
          sections.put(sectionObj);
          section += sections;
  
          section +="&amp;";
  </code></pre>
  
  <p>But In actual it my section boundary parameter going as string instead of list. Like this </p>
  
  <pre><code> boundary=[
    [
      0.0,
      0.1
    ],
    [
      0.0,
      0.1
    ]
  ],storeid=156&amp;floor=2&amp;section=[
    {
      "id": 0,
      "sectionname": "mobiotics",
      "category": "office",
      "boundary": "[[0.0, 0.1], [0.0, 0.1]]", // See here is my problem ...
      "description": "Mobile based company"
    }
  ],entry=[
    10,
    15
  ],exit=[
    10,
    15
  ]   
  </code></pre>
  
  <p>How to send it as list instead of string. Need Help. Thank you.</p>