0
{
"CustomerDetails": [
{
"AccountName": "test",
"DnBNumber": 12342314
}
]
特殊价值我想从这个JSON对象获得价值。
我在下面试过但没有工作。
jsonObject.getJSONObject("AccountName").toString();
{
"CustomerDetails": [
{
"AccountName": "test",
"DnBNumber": 12342314
}
]
特殊价值我想从这个JSON对象获得价值。
我在下面试过但没有工作。
jsonObject.getJSONObject("AccountName").toString();
在你把JSON,有的JSONObject包含JsonArray,包含两个字符串,所以..
final JSONObject jsonObject = new JSONObject(YOUR_JSON);
final JSONArray jsonArray = obj.getJSONArray("CustomerDetails");
for (int i = 0; i < geodata.length(); ++i) {
final JSONObject detail = geodata.getJSONObject(i);
System.out.println(detail.getString("AccountName"));
System.out.println(detail.getString("DnBNumber"));
}
哪种语言你在说什么? –
[在Java中解析JSON字符串]的可能重复(https://stackoverflow.com/questions/11874919/parsing-json-string-in-java) – adalPaRi