好比說List<Strudent>java
List轉Jsonjson
List<Student> students = new ArrayList(); String str = JSON.toJSONString(students); // List轉json
Json 轉List 方法一數組
String json = ""; //獲取的Json數據 List<Student> students = JSON.parseObject(json,new TypeReference<List<Student>>(){}); // Json 轉List
Json 轉List方法二spa
List<Student> students = JSON.parseArray(json,Student.class);
Student 對象要實現Serializable接口code
import java.io.Serializable; public class Student implements Serializable{