I am trying to extract Key and values from my JSONObject. But i am not able to do that. Here is the JSON:
[{\"id\":[\"5\"]},{\"Tech\":[\"Java\"]}]
Parameter you are sending is JsonArray and referring to JsonObject. The Correct way is
JSONObject jsonObj = new JSONObject("{'id':['5','6']},{'Tech':['Java']}");
System.out.println(jsonObj.getString("id"));
JSONArray jsonArray = new JSONArray("[{'id':['5','6','7','8']},{'Tech':['Java']}]");
System.out.println(jsonArray.length());
for(int i=0;i