- fastJson
public class City {
String code;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
public static void main(String[] args) {
String jsonString = "jsonlist字符串"
List<City> cityList = JSONArray.parseArray(jsonString, City.class);
if (cityList!=null){
for (City city : cityList) {
System.out.println(city.getCode());
}
}
}