title: JSON object retrieving sub values
body: <p>Below is my json object.</p>
  
  <pre><code>{
    "result":"ok",
    "data":{  
            "buy":174.03,
            "sell":160.64,
            "timestamp":"2017-12-24T08:46:45.487+00:00"
     }
  }
  </code></pre>
  
  <p>I parse it using code and try outputting the value: </p>
  
  <pre><code>JSONObject json = new JSONObject(jsonValue);
  System.out.println(json.getString("result"));
  System.out.println(json.getJSONObject("data").getString("buy"));
  </code></pre>
  
  <p>I can print out the value of result.
  But how do I print out the value of data. buy ?
  I get error 
         <code>org.json.JSONException: JSONObject["buy"] not a string.</code></p>