JSON数组转换为List

1.List> listObjectSec = JSONArray.parseObject(strArr,List.class);

 

for (Map mapList : listObjectSec){

 

  for  (Map.Entry entry : mapList.entrySet()){

 

    System.out.println( entry.getKey()  +  "  "  +entry.getValue());

 

    }
}
 

2.List> listObjectFir = (List>) JSONArray.parse(strArr);

 

for (Map mapList : listObjectFir){

 

  for  (Map.Entry entry : mapList.entrySet()){

 

    System.out.println( entry.getKey()  +  "  "  +entry.getValue());

 

  }
}

 

转载于:https://www.cnblogs.com/aaron95/p/11451770.html

你可能感兴趣的:(JSON数组转换为List)