Public static void main (string [] ARGs ){
String jsonstring = "[{\" ID \ ": \" 1 \ ", \" fields \ ": [{\" Name \ ": \" Age \", \ "value \": 10 },{ \ "Name \": \ "ID \", \ "value \": \ "1 \"}, {\ "Name \": \ "Name \", \ "value \": \ "name-1 \"}] },{ \ "ID \": \ "2 \", \ "fields \": [{\ "Name \": \ "Age \", \ "value \": 10 }, {\ "Name \": \ "ID \", \ "value \":
\ "2 \" },{ \ "Name \": \ "Name \", \ "value \": \ "name-2 \"}] ";
Jsonarray ja = jsonarray. fromobject (jsonstring );
Jsonobject JB = (jsonobject) Ja. Get (0 );
System. Out. println (JB. getstring ("fields "));
// Use a map as an Example
Map <string, string> map = new hashmap <string, string> ();
// Add a data record for the map and upload the loginname on the page
Map. Put ("name", "test ");
Map. Put ("password", "password ");
// JSON processing of the map object to be returned
Jsonobject Jo = jsonobject. fromobject (MAP );
System. Out. println ("*********");
// Call the tostring method of the json object to convert it to a string and assign it to result
String result = Jo. tostring ();
System. Out. println (result );
// [{"Name": "Age", "value": 10 },{ "name": "ID", "value": "1 "}, {"name": "name", "value": "name-1"}]
//*********
// {"Name": "test", "password": "password "}
}