title: how to access json array element in java
body: <p>i am getting json array in the output.i want to access the specific key elments from the response .how can i ..?</p>
  
  <pre><code> ResponseEntity &lt;String&gt; respone;
        try {
            response =
        restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class);
  
  
  
        String response=response.getBody(); 
        JSONObject res = new JSONObject();
        res.put("result", response);
        System.out.println(res);
        int len=res.size();
        System.out.println(len);
        JSONParser parser=new JSONParser();
          Object obj = parser.parse(response);
          JSONArray array = (JSONArray)obj;
          System.out.println(array.get(0)); } 
  </code></pre>
  
  <p>this is respponse format i m getting in output.i want to access the bid from the response.how can i?</p>
  
  <pre><code>  [
        {
              "bName": "abc", 
              "bId": "n86nbnhbnghgy76"
  
            }
          ]
  </code></pre>