项目地址:https://gitee.com/neimenggudaxue/BasicTest/commit/94286b2520538885f9197a0dc63e022b3453da79
JSONArray主要使用作示例一,示例二至今未搞懂
一、JSONArray.parseArray示例
str=
[
{
"name":"qq",
"age":"6",
"sex":"F"
},
{
"name":"qq",
"age":"6",
"sex":"F"
},
{
"name":"qq",
"age":"6",
"sex":"F"
}
]
List<Student> stuList= JSONArray.parseArray(strList,Student.class);
Student student1=stuList.get(0)
二、JSONArray.parseObject示例
str=
{
"name":"qq",
"age":"6",
"sex":"F"
}
Student student=JSONArray.parseObject(str,Student.class);
网友评论