how to iterate json String
<p>I have an array of JSON strings like:</p>

<pre><code>[{
"id":"BirthDate",
"field":"BirthDate",
"type":"date",
"input":"text",
"operator":"equal",
"value":"2016/04/07"
}]
</code></pre>

<p>I want to be able to iterate this array and want to get its id, field, value in Java</p>

<p>Using the below code I got an exception 
"json object must begin with {"</p>

<pre><code>String rules=helper.getRules();
    System.out.println("====Rulses=====:"+rules);
      try {
           JSONObject obj = new JSONObject(rules);
           System.out.println("====obj===="+obj);
          // boolean error = obj.getBoolean("error");
           String id = obj.getString("id");
           System.out.println("===id is===: "+id);
      } catch (JSONException e){
          e.printStackTrace();
      }
</code></pre>