How to Create JSONArray for a List

后端 未结 7 2044
南旧
南旧 2020-12-30 00:47

I have a class called

class Student {
   String name;
   String age;
}

I have a method that returns List object like

publi         


        
7条回答
  •  孤独总比滥情好
    2020-12-30 01:30

    I think you need not download the jettison jar file.

    Using JSONArray and JSONObject you can easily convert that list into JSON object like @Juniad answer

提交回复
热议问题