List<String> list =
new
ArrayList<String>();
JSONArray jsonArray = JSONArray.fromObject(list);
Student student =
new
Student(
"name"
,
"age"
,
"class"
);
JSONObject jsonObject = JSONObject.fromObject(student);
然后你就可以返回jsonArray或者jsonObject了