Gson解析json,没有key,不确定key,javabean写法

1.没有key
json:

{
    "person":[
        {
            "name" : "hello",
            "childs" : ["few", "gr3"]
        },
        {
            "name" : "world",
            "childs" : ["h4w", "ku6r"]
        }
    ]
}

jsonBean:

public class JsonBean {

    public ArrayList person;

    public static class Person{
        String name;
        ArrayList childs;
    }
}

2.不确定key
json:

{
    "person":[
        {
            "name" : "hello",
            "childs" : [{"1":"few"}, {"2":"akuy"}]
        },
        {
            "name" : "world",
            "childs" : [{"8":"ngf"}, {"9":"y54"}]
        }
    ]
}

jsonbean:

public class JsonBean {

    public ArrayList person;

    public static class Person{
        String name;
        ArrayList> childs;
    }
}

你可能感兴趣的:(Gson解析json,没有key,不确定key,javabean写法)