title: JSON : how to save JSON Array using Java and loop till last JSON Object
body: <p>I'm new to JSON and have below file. I have to save the array "steps" in java and need to loop the objects "duration" , "status"  and "Keyword".</p>
  
  <pre><code>"steps": [
        {
          "result": {
            "duration": 7128811788,
            "status": "passed"
          },
          "line": 5,
          "name": "The Browser is Launched and Smart Business URL is loaded",
          "match": {
            "location": "Common_Login.the_Browser_is_Launched_and_Smart_Business_URL_is_loaded()"
          },
          "keyword": "Given "
        },]
  </code></pre>
  
  <p>I tried below but didn't worked.</p>
  
  <pre><code>JSONParser parser = new JSONParser();
  Object obj = parser.parse(new FileReader("./target/JSON/Output.json"));
  JSONArray jsonArray = (JSONArray) obj;
  System.out.println(jsonArray);
  
  for (int i = 0; i &lt; jsonArray.size(); i++) {
      JSONObject jsonObjectRow = (JSONObject) jsonArray.get(i);
      name = (String) jsonObjectRow.get("duration");
      id = (String) jsonObjectRow.get("status");
      uri = (String) jsonObjectRow.get("name");
      status = (String) jsonObjectRow.get("location");
  }
  </code></pre>