my output "abc":[{"1":1,"2":2,"3":1,"4":2,"5":1,"6":2,"7":1,"8":2,"9":1,"10":2,"11":1}]
//mycode
JSONArray jsonArray = new JSONArray();
JSONObject jsonObject = new JSONObject();
for(QuizAttempt order_product:products){
//jsonArray.put(order_product.getAns());
jsonObject.put(order_product.getId(),order_product.getAns());
}
//jsonObject.put()
jsonArray.put(jsonObject);
paramObject.put("abc",jsonArray);
I getting out as I have shown above and above is my code but I want my output as
"abc":[{"1":"1","2":"2","3":"1","4":"2","5":"1","6":"2","7":"1","8":"2","9":"1","10":"2","11":"1"}]
Help me to solve this problem Thank you all in advance