将json字符串转成Java的Array数组
private String json = "{\"address\":\"chian\",\"birthday\":{\"birthday\":\"2010-11-22\"},"+
"\"email\":\"
[email protected]\",\"id\":22,\"name\":\"tom\"}";
@Test
public void readJSON2Array() {
try {
json = "[" + json + "]";
jsonArray = JSONArray.fromObject(json);
Object[] os = jsonArray.toArray();
System.out.println(os.length);
Student[] stus = (Student[]) JSONArray.toArray(jsonArray, Student.class);
System.out.println(stus.length);
System.out.println(stus[0]);
} catch (Exception e) {