title: Extracting JSON fields using java
body: <p>I am trying to extract a person's details who liked a facebook page by passing the page id as parameter. I extracted the JSON content of that page and now from that I want to extract name and id of users. </p>
  
  <p>How do I achieve that ?</p>
  
  <h2>Code:</h2>
  
  <pre><code>JSONObject json = readurl("https://graph.facebook.com/pageid");
  System.out.println(json.toString());
  System.out.println("Page id is:"+json.get("id"));
  </code></pre>
  
  <h2>JSON:</h2>
  
  <pre><code>"likes":{
  "data":[
      {
          "id":"*******",
          "name":"vv"
      },
      {
          "id":"********",
          "name":"abc"
      },
  </code></pre>