假设JSON数组:
JSONArray list1 = new JSONArray();
[{"Name":"deep","Id":1001}]
JSONArray list2 = new JSONArray();
[{"Dept":"dept123"}]
我想
[{"Name":"deep","Id":1001,"Dept":"dept123"}]
答案 0 :(得分:0)
1. for i in range(0, len(list1)):
2. currentVal <- list1.get(i) //get ith element
3. currentVal.append(list2.get(i))
这个概念是迭代一个数组并访问两个数组的第i个元素的字典,并在list1的字典中,附加你从list2获得的字典