使⽤fastjsonlist和String互转本⽂说的是alibaba的fastjson  它提供了各种json和对象、集合的转化。
⽐如说List<Strudent>
List转Json
List<Student> students = new ArrayList();
String str = JSONString(students); // List转json
Json 转List ⽅法⼀
String json = ""; //获取的Json数据
fastjson怎么用List<Student> students = JSON.parseObject(json,new TypeReference<List<Student>>(){}); // Json 转List Json 转List⽅法⼆
List<Student> students = JSON.parseArray(json,Student.class);
Student 对象要实现Serializable接⼝
import java.io.Serializable;
public class Student implements Serializable{ }