0
解析數組的數組我有數組的數組JSON這樣的Java:從JSON
{
"width" : 500,
"numbers" : [
[46, 11, "1674"],
[46, 11, "1673"],
[46, 11, "1677"],
[46, 11, "1678"],
[46, 11, "1674"],
[46, 11, 1673]
]
}
而且我不知道如何解析它。
JSONObject json = new JSONObject(jsonString);
JSONArray jsonArray = json.getJSONArray("numbers");
此代碼將引發類型錯誤匹配錯誤。
什麼JSON庫您使用?它可能無法應付內部數組中的混合類型。 – michid