I am getting following response from an API
String response={"balance":1000,
"lastliability":2000,"profitarray":[[1,2,3],[67,88,99]],"previous":[99,88]}
I am trying to convert profitarray to ArrayList in Java like
JSONObject res=new JSONObject(response);
ArrayList<ArrayList<Integer>> temp=res.getString("profitarray")//something like this
ArrayList<Integer>yy=res.getString("previous");
Obviously, the outputs of res.getstring will be String and I want to convert them to ArrayList, any idea how to do it?
profitarray":[[1,2,3],[67,88,99]]from the response ? How to get[[1,2,3],[67,88,99]]from the response ? or how to convert this[[1,2,3],[67,88,99]]from a String to arraylist of Integers ?