I have a JSONArray like below
System.out.println(jsonArray.get(i));
//output
["4","3","2","1","3","5","6"]
How can i access the values inside the array. For Example if i want value 2 from the above array which is at index 2, what should i use to get the value
jsonArray.get(2)does not work?jsonArray.get(i).getInt(2)work? It looks like you have a multidimensional array.jsonArray.get(i).getInt(2)is not working..The method getInt(int) is undefined for the type Objectget, it returns a java object. To return aJSONObject, you have to look for the methods that haveJSONin their name, likegetJSONArray- which is what you need