title: Java JSON -Jackson- Nested Elements
body: <p>My JSON string has nested values. </p>
  
  <p>Something like </p>
  
  <p><code>"[{"listed_count":1720,"status":{"retweet_count":78}}]"</code></p>
  
  <p>I want the value of the <code>retweet_count</code>.</p>
  
  <p>I'm using Jackson.</p>
  
  <p>The code below outputs "<code>{retweet_count=78}</code>" and not <code>78</code>. I'm wondering if I can get nested values the kind of way PHP does it i.e <code>status-&gt;retweet_count</code>. Thanks.</p>
  
  <pre><code>import java.io.IOException;
  import java.util.List;
  import java.util.Map;
  import org.codehaus.jackson.map.ObjectMapper;
  import org.codehaus.jackson.type.TypeReference;
  
  public class tests {
  public static void main(String [] args) throws IOException{
      ObjectMapper mapper = new ObjectMapper();
    List &lt;Map&lt;String, Object&gt;&gt; fwers = mapper.readValue("[{\"listed_count\":1720,\"status\":{\"retweet_count\":78}}]]", new TypeReference&lt;List &lt;Map&lt;String, Object&gt;&gt;&gt;() {});
      System.out.println(fwers.get(0).get("status"));
  
      }
  }
  </code></pre>