How do I parse a JSONArray in Java with Json.simple?

前端 未结 3 553
再見小時候
再見小時候 2020-12-30 04:35

I am trying to read a JSON file like this:

{
  \"presentationName\" : \"Here some text\",
  \"presentationAutor\" : \"Here some text\",
  \"presentationSlide         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-30 05:22

    You never assign a new value to jsonObject, so inside the loop it still refers to the full data object. I think you want something like:

    JSONObject slide = i.next();
    String title = (String)slide.get("title");
    

提交回复
热议问题