title: how to assign a list to another list?
body: <p>i have one problem with handling list,i have three class named as UserInf,userData,userProcess,i created one  generic list using  UserInf class, and i need to set that list to another list which is in class userprocess,this my sample code*</p>
  
  <pre><code>public class UserInf 
  {
      private List&lt;Data&gt; pData;
  
      private String userId;
  
  public void setData(List&lt;Data&gt; pData)
      {
          this.pData=pData;// Need to assign the fpData
      }
      public List&lt;Data&gt; getData()
      {
          return this.pData;
      }
  
      public void setUserId(String userId)
      {
          this.userId = userId;
      }
      public String getUserId()
      {
          return userId;
      }
  </code></pre>
  
  <p>in my other  class userdata i cretaed list using userInf,add adding the value like this</p>
  
  <pre><code>List&lt;UserInf&gt; userInformation=new ArrayList&lt;UserInf&gt;();
  UserInf userInfo=new UserInf();
  userInfo.setUserId(userid);
    userInfo.setData(pdata);
  userInformation.add(userInfo);//up to this working fine
  
  
  }
  </code></pre>
  
  <p>in my other class userprocees, i want to assign the userInformation list to another list i created object for userInf class ang get the property and assign to my new list</p>
  
  <pre><code>List&lt;UserInf&gt; userProcessList=new ArrayList&lt;UserInf&gt;();
  UserInf userProcess=new UserInf();
  userProcess.getData();
  userProcess.getUserId();
  userProcessList.add(userProcess);//problem is here
  </code></pre>
  
  <p>but this is not working how to assign list to another list like this in java</p>