假设我有一个json
{
"data": {
"json": [
{
"value": [
"john","joy"
],
"key": "Names"
},
{
"value": [
"25A",
"26B"
],
"key": "john"
},
{
"value": [
"27A",
"28B"
],
"key": "joy"
}
]
}
}
我想为每个值创建一个Dynamic ArrayList名称,如下所示
for(String name:Names){
//create a dynamic arraylist from the names here like
// ArrayList<String> joy= ..........
}
有人可以帮我这个吗?
答案 0 :(得分:1)
也许使用
Map<String, List<String>> map = new HashMap<String, List<String>>();
map.put("arrayname", new ArrayList<String>());