Exception in thread "main" org.json.JSONException: A JSONArray text must start with '[' at 1 [character 2 line 1] at org.json.JSONTokener.syntaxError(JSONTokener.java:501) at org.json.JSONArray.<init>(JSONArray.java:89) at org.json.JSONArray.<init>(JSONArray.java:142) at hello.Lautturi.main(Lautturi.java:87)
String jsonString = "{\"id\":111,\"name\":\"Lautturi\"}"; JSONArray data = new JSONArray(jsonString);
The json string should begin with [ (left bracket) and ends with ] (right bracket).
``` java String jsonString = "[{\"id\":111,\"name\":\"Lautturi\"}]";