title: How to refer to an inner class inside a list in Java
body: <p>after messing around with parsing a JSON response with GSON for a day, I finally figured out how to get my javabeans right in order to extract my data from the response. This is the layout of my nested classes and lists:</p>
  
  <pre><code>    public class LocationContainer {
  
      public class paging {
          private String previous;
          private String next;
      }
  
  
      private List&lt;Datas&gt; data;
  
      public class Datas {
  
  
          private String message;
          private String id;
          private String created_time;
  
          public class Tags {
              private List&lt;Data&gt; datas;
              public class Data {
                  private String id;
                  private String name;
              }
  
          }
  
          public class Application {
  
                  private String id;
                  private String name;
  
          }
  
          public class From {
              private String id;
              private String name;
  
          }
  
          public class Place {
              private String id;
              private String name;
              public class Location {
                  private int longitude;
                  private int latitude;
                          }
  
  
          }
  
      }
  
  }
  </code></pre>
  
  <p>Now I am trying to get a hold of the name string inside the place class and the created_time string, but since I am quite a noob, I can't seem to figure it out.</p>
  
  <p>I was able to extract the created_time string by using </p>
  
  <pre><code>String time = gson.toJson(item.data.get(1).created_time);
  </code></pre>
  
  <p>However using </p>
  
  <pre><code>String name = gson.toJson(item.data.get(1).Place.name);
  </code></pre>
  
  <p>doesnt work.</p>
  
  <p>The item class is an instance of LocationContainer filled with the output from GSON.
  Any pointers would be greatly appreciated.</p>