如何将JSONArray的内容分解为新行

时间:2017-05-17 13:56:16

标签: java arrays json

我试图将我的JSON结果分解为新行,但发现很难做到。 例如,{"id":"1","student_id":"5013","subject1":"87","subject2":"87","subject3":"56","subject4":"76","subject5":"68","subject6":"58","subject7":"98","subject8":"67","subject9":"88"}

    id : 1
    student_id : 5013
    subject1 : 87
    subject2 : 87
...

我尝试使用

    String[] stringsArray = new String[jArray.length()];
             for (int i = 0; i < jArray.length(); i++) {
                    System.out.println(stringsArray[i] = jObj.getString(i) + "\n");
}

但仍然给出相同的结果。 感谢。

0 个答案:

没有答案