title: Java reading json :reading data from json array which present inside json object
body: <p>I want read json file using java .
  content of my json files are as below </p>
  
  <pre><code>
  {
    "ServiceData": {
      "ServiceInfo": [     
        {
          "trav": "20200131T173017Z",
          "real": "MyService",
          "lintruntime": "7",
          "upload": "184",
          "build": "1717",
          "buildproductruntime": "1709",
          "EXITCODE": "0",
          "totaltime": "3610"
        },
        {
          "trav": "20200131T173024Z",
          "real": "ERSampleService1",
          "lintruntime": "38",
          "upload": "381",
          "build": "1765",
          "buildproductruntime": "1767",
          "EXITCODE": "0",
          "totaltime": "3913"
        }
      ]
    }
  }
  </code></pre>
  
  <p>How can do it using simple json I tried below  but it's not working </p>
  
  <pre><code>public static void main(String args[])
      {
           try {
                Object obj = new JSONParser().parse(new FileReader("metricDataFinal.json"));  
                JSONObject jo = (JSONObject) obj; 
                Map ServiceData = ((Map)jo.get("ServiceData")); 
                Iterator&lt;Map.Entry&gt; itr1 = ServiceData.entrySet().iterator(); 
                  while (itr1.hasNext()) { 
                       JSONArray ja = (JSONArray) jo.get("ServiceInfo"); 
                       Iterator itr2 = ja.iterator(); 
  
                       while (itr2.hasNext())  
                       { 
                           itr1 = ((Map) itr2.next()).entrySet().iterator(); 
                           while (itr1.hasNext()) { 
                               Map.Entry pair = itr1.next(); 
                               System.out.println(pair.getKey() + " : " + pair.getValue()); 
                           } 
                       } 
                      Map.Entry pair = itr1.next(); 
                     // System.out.println(pair.getKey() + " : " + pair.getValue()); 
  
  
  
                  } 
  
           }catch(Exception e)
           {
  
           }
  }
  
  
  </code></pre>
  
  <p>how to read data from for json   I wanted to do processing on this data 
  Please let me know if anyone knows how to do it</p>