Quantcast
Channel: Loop through nested JSON array - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by lewis machilika for Loop through nested JSON array

You may try public void printJsonObject(JSONObject jsonObj) { for (String keyStr : jsonObj.keySet()) { Object keyvalue = jsonObj.get(keyStr); //Print key and value System.out.println("key: "+ keyStr +"...

View Article


Answer by ramin bakhshpour for Loop through nested JSON array

you need a recursive function.function iterateTree(object) { if (!object) { //recursion stop criteria || you need to implement what your stop criteria is return; } //doSomthingWithObject();...

View Article

Loop through nested JSON array

I have a JSON response that looks like this:{"1":{"id":"1","user_id":"1","children":[ {"id":"2","user_id":"2","children":[ {"id":"3","user_id":"3","children":[ {"id":"4","user_id":"2","children":[ ] }...

View Article
Browsing all 3 articles
Browse latest View live