```java
public void test(){
Hello hello = new Hello();
hello.setAge("122");
hello.setName("djsdj");
hello.setSex("mail");
Hello helloq = new Hello();
hello1.setSex("hah");
hello1.setAge("jjj");
hello1.setName("fdf");
Listlist =new ArrayList<>();
list.add(hello);
list.add(helloq);}```
1.首先去使用androidstudio 下载gson compile 'com.google.code.gson:gson:+'
2.将集合gson转换成集合 `Gson gson = new Gson(); String l=gson.toJson(list); Log.i("hashah","list ="+l); Type listType = new TypeToken>() {}.getType(); List list1 =gson.fromJson(l,listType);
for (Hello hello2:list1){
Log.i(",,,,,","age ="+hello2.getAge());
}`
3.将对象和集合转换成gson
String s = JSON.toJSONString(hello);
4.将gson转换成对象
`String test ="{\"age\":\"122ewewew\",\"name\":\"djsdjewe\",\"sexwe\":\"mailwe\"}";
Hello hello11 = JSON.parseObject(test,Hello.class);`
5.fastjson在线拉取 compile'com.alibaba:fastjson:+'