私はJava http://json.org/java/のJSONの初心者です
このような JSON オブジェクトを作成するにはどうすればよいですか?
{
"RECORD": {
"customer_name": "ABC",
"customer_type": "music"
}
}
私はJava http://json.org/java/のJSONの初心者です
このような JSON オブジェクトを作成するにはどうすればよいですか?
{
"RECORD": {
"customer_name": "ABC",
"customer_type": "music"
}
}
"RECORD" を JSON オブジェクトにする必要があります。これは例です:
JSONObject json = new JSONObject();
// Add a JSON Object
JSONObject Record = new JSONObject();
Record.put( "customer_name", "ABC");
Record.put( "customer_type", "music");
json.put( "RECORD", Record);
// P toString()
System.out.println( "JSON: " + json.toString() );