java - Parse JSON with unknown key? -


i have json output :

enter image description here

the numbers 2922 , 3910 random numbers. how can store values in "name" in array?

thank you.

you can use iterator.

using iterator, can iterate elements of list in either direction. can access next element calling next() method .

jsonobject reader = new jsonobject(success);               iterator  iteratorobj = reader .keys();                 arraylist<string> al_getallkeys=new arraylist<string>();                 while (iteratorobj.hasnext())                 {                     string getjsonobj = (string)iteratorobj.next();                     .....                    system.out.println("key: " + key + "------>" + getjsonobj);                  } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -