title: How to create a Java Object for the nested json Using POjo class
body: <p>I am facing issue in generating java object for this sample nested json format</p>
  
  <pre><code>{
  "Id":"id1",
  "Eid":"eid1",
  "tar":"pro",
  "highlights":[{
    "name":"l-p"
    "Data":{
         "dataid":"did1"
         }
       },
  {
    "name":"c-p",
    "Data":{
         "dataid":"did2"
         }
       },
  {
    "name": "ename",
     "Data": {
         "enamedetails":"details"
  }
  }]
  }
  </code></pre>
  
  <p>I have generated getter setter methods for id,eid and tar but not sure how to generate for highlights. and convert the same into json using gson.</p>
  
  <p>Getter setter Methods:</p>
  
  <pre><code>public class hello implements intt{
  
         @SerializedName("ID")
         private String ID = null;
  
         @SerializedName("Eid")
         private String Eid=null;
  
         @SerializedName("tar")
         private String tar=null;
  /**
         * @return the Id
         */
         public String getId() {
                return Id;
         }
  
         /* (non-Javadoc)
         * @see java.lang.Object#toString()
         */
         @Override
         public String toString() {
                return "EDetails [ID=" + ID
                             + ", eid=" + eid+ ", tar=" + tar
                             + "]";
         }
  
         /**
         * @param Id the Id to set
         */
         public void setId(String Id) {
                this.Id= Id;
         }
  
         /**
         * @return the eid
         */
         public String geteid() {
                return eid;
         }
  
         /**
         * @param eid the eid to set
         */
         public void seteid(String eid) {
                this.eid= eid;
         }
  
         /**
         * @return the tar
         */
         public String gettar() {
                return tar;
         }
  
         /**
         * @param tar the tar to set
         */
         public void settar(String tar) {
                this.tar= tar;
         }
  </code></pre>
  
  <p>In implementation class,</p>
  
  <pre><code>edetails.setId("id1");
  edetails.settar("pro");
  edetails.seteid("eid1");
   Gson gson = new Gson();
   String sDetails=gson.toJson(edetails);
  </code></pre>
  
  <p>Not sure how to do this for nested json class</p>