java - extract from a multiple json -


i have json this:

[{"id":"****","value":"*****","date":"****"}, {"id":"****","value":"*****","date":"****"}, {"id":"****","value":"*****","date":"****"}, {"id":"****","value":"*****","date":"****"}] 

every "sub-json" want convert model object.(an object contains attributes id value , date). how can it? thank you.

you got array of objects.

jsonarray jsonarray = new jsonarray(jsonstr); (int = 0; < jsonarray.length(); i++) {    jsonobject jsonobject = jsonarray.getjsonobject(i);    string id = jsonobject.getstring("id");    string value = jsonobject.getstring("value"); } 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -