How do I parse JSON objects from a JSONArray?

后端 未结 5 1197
南旧
南旧 2021-01-24 06:18

I have a very large JSON file in the following format:

[{\"fullname\": \"name1\", \"id\": \"123\"}, {\"fullname\": \"name2\", \"id\": \"245\"}, {\"fullname\": \         


        
5条回答
  •  执念已碎
    2021-01-24 06:54

    Okay folks...just solved my problem. I am posting the solution in case someone runs into the same issue again, can use my solution. My solution is partly motivated by Rahul Rabhadiya. Thanks, dude.

    try{
     row=br.readLine();
                JSONArray root = (JSONArray) JSONValue.parseWithException(row);
    
                for (int i=0;i

提交回复
热议问题