title: Adding to ArrayList constructor
body: <p>I got a question regarding ArrayLists, I can't seem to wrap my head around the concept. Basically I'm making an ArrayList without the main method in the constructor. I need to add multiple 'users' to my ArrayList, just I can't seem to figure out a way to do it.</p>
  
  <pre><code>package lab4;
  
  import java.util.ArrayList;
  
  public class UserGroupz{
  
  private ArrayList&lt;User&gt; users;
  
      public UserGroupz(){
          users = new ArrayList&lt;User&gt;();
      }
  
          //MY PROBLEM IS IN THIS METHOD BELOW!
      public void addSampleData(User user){
          users.add(user);
      }
  
  
  
      public int numberOfUsers(){
          return users.size();
      }
  
      public void printUsernames(int userNumber){
          if(userNumber &lt; 0){ 
          }
          else if(userNumber &lt; numberOfUsers()){
              System.out.println(users.get(3));
          }
          else{
          }
      }
      public void listUsers(){
          for(User allUsers : users){   
              System.out.println(allUsers);
          }
      }
  
  }
  </code></pre>