Java tutorial
//package com.java2s; //License from project: Apache License import org.json.JSONArray; import org.json.JSONException; import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> parseIntegerJsonList(JSONArray array) throws JSONException { if (array == null) { return new ArrayList<Integer>(); } int size = array.length(); ArrayList<Integer> list = new ArrayList<Integer>(size); for (int i = 0; i < size; i++) { list.add(array.getInt(i)); } return list; } }