title: How to parse a JSONArray of JSONObjects in JAVA?
body: <p>I have the following array returned to my JAVA Android application from PHP:</p>
  
  <pre><code>Array ( [0] =&gt; Array ( [referral_fullname] =&gt; Name 1 [referral_balance] =&gt; 500 ) [1] =&gt; Array ( [referral_fullname] =&gt; Name 2 [referral_balance] =&gt; 500 ) );
  </code></pre>
  
  <p>In Java they above array looks like this:</p>
  
  <pre><code>{"0":{"referral_fullname":"Name 1","referral_balance":"500"},"1":{"referral_fullname":"Name 2","referral_balance":"500"}};
  </code></pre>
  
  <p>For a simple JSONObject I'm using:</p>
  
  <pre><code>JSONTokener tokener = new JSONTokener(result.toString());
  JSONObject finalResult = new JSONObject(tokener);
  
  referral_fullname = finalResult.getString("referral_fullname");
  </code></pre>
  
  <p>but for an array of objects I don't know!</p>