title: Retrieve just one field from JSON string in Java
body: <p>Is there a way to just one field from the JSON string? My code is as follows:</p>
  
  <pre><code>Object obj = parser.parse(resp);
  System.out.println(obj);
  JSONArray array = new JSONArray();
  array.add(obj);
  
  JSONObject obj2 = (JSONObject)array.get(0); //Getting NPE here
  //Object obj3 = obj2.get("data");
  
  System.out.println("Data: " + obj2.get("data"));
  //System.out.println("Email: " + obj3.get("email_address"));    
  </code></pre>
  
  <p>I'm using the following libraries</p>
  
  <pre><code>import org.json.simple.JSONObject;
  import org.json.simple.JSONArray;
  import org.json.simple.parser.ParseException;
  import org.json.simple.parser.JSONParser;
  </code></pre>
  
  <p>From the response string resp, I just need data.email_address. I am unable to find a way to do it.</p>