title: How to read JSON data with Java
body: <p>Am having a problem reading/parsing the following JSON string in Java.</p>
  
  <p>Code:</p>
  
  <pre><code>try{
    json = new JSONObject(result);
  //json now looks like this :-
  // {'header': '[{"doc_no": "DN00001","stage":"P"}]','section':'[{"upper":100,"lower":1]'}
    if (json != null){
       // this line is throwing an exception!!
       JSONObject header =  new JSONObject("header");
     }catch(JSONException e){
      // Error Message
  }
  </code></pre>
  
  <p>I've also tried this:</p>
  
  <pre><code>JSONArray  header = json.getJSONArray("header");
  </code></pre>
  
  <p>but still throwing some exception.</p>
  
  <p>What am I missing?</p>