title: JSONArray to String in java
body: <p>I have an <code>JSONArray</code> that looks  like this:</p>
  
  <p><img src="https://i.stack.imgur.com/18F7a.png" alt="enter image description here"></p>
  
  <p>how can i convert that to a string?</p>
  
  <p>if i try: </p>
  
  <pre><code>json.toString();
  </code></pre>
  
  <p>the string is:</p>
  
  <pre><code>["package.package.ChecklistModels.ChecklistAnswer@405dddd8","package.package.ChecklistModels.ChecklistAnswer@405ddf48","package.package.ChecklistModels.ChecklistAnswer@405de070","package.package.ChecklistModels.ChecklistAnswer@405de198","package.package.ChecklistModels.ChecklistAnswer@405de2c0","package.package.ChecklistModels.ChecklistAnswer@405de3e8","package.package.ChecklistModels.ChecklistAnswer@405de510"]
  </code></pre>
  
  <p>but i want something like this:</p>
  
  <pre><code>    {
   "json": 
      "values": [
          {
              "answer": "true",
              "remark":"",
              "questionId": "0"
              "checklistId": "2"
          },
          {
              "answer": "true",
              "remark":"",
              "questionId": "0"
              "checklistId": "2"
          }
      ]
  }
  </code></pre>
  
  <p>EDIT:</p>
  
  <p>this a snipped how i make the json array:</p>
  
  <pre><code>   if(cb.isChecked() || !text.getText().toString().equals("")){
                      ChecklistAnswer answer = new ChecklistAnswer(questions.get(id).id, 2, cb.isChecked(), text.getText().toString());
  
                      answers.add(answer);
                  }
              }
              JSONArray json = new JSONArray(answers);
              String jsonString = json.toString();
  </code></pre>