JSONObject[“sum”] not found while parsing JSON in Java
问题 I have a problem. I wrote the JSON parsing code, but it gives me an error. I don't understand what the problem is. String result is JSON.I need to output the amount value from sum. Returns an error: "JSONObject["sum"] not found." JSONObject json = new JSONObject(result); JSONObject bpi = json.getJSONObject("sum"); String uuu = bpi.getString ("amount"); System.out.println(uuu); { "data": [ { "txnId": 20071336083, "personId": 1, "date": "2020-10-21T20:10:56+03:00", "errorCode": 0, "error": null