import java.io.FileReader;
      import org.json.simple.JSONArray;
      import org.json.simple.JSONObject;
      import org.json.simple.parser.*;
      
      Object jsonObjectGeneric = new JSONParser().parse(new FileReader("/path/to/your/file.json"));
      JSONObject jsonObject = (JSONObject) jsonObjectGeneric;
      // String attributeValue = (String) jsonObject.get("attribute")
      // JSONArray jsonArray = (JSONArray) jsonObject.get("attributeArray");

      Java language logo
      Read JSON file

      json
      Java Public Recipes

      Read a JSON file using org.json.simple

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.