1

This is my json response

"row":{"no":"1","SK":[{"val1":"sathees","val2":"FirstName"},{"val1":"Ramu","val2":"FirstName}]}

This is my code

Object js4 = parser.parse(row.toString());
JSONArray array = new JSONArray();
array.add(js4);
for (int i = 0; i < array.size(); i++) {
    JSONObject jsonObjectRow = (JSONObject) array.get(i);
    String no = (String) jsonObjectRow.get("no");
    String fl = (String) jsonObjectRow.get("FL");
}
Sergey Kalinichenko
  • 714,442
  • 84
  • 1,110
  • 1,523
Sathees
  • 11
  • 2
  • Don't use the `get` methods. Use the methods that return the type of data that you want. Strings and JSONObject, for example. No casting should be necessary – OneCricketeer Oct 14 '16 at 13:20

0 Answers0