title: Using an objects list for each object java
body: <p>my question is:
  How would I as an admin (already have admin menu and everything setup) add hours played by a character (everytime they play a game, a new int is added to the list of how many hours played via code I've already made) on their own hoursPlayed list? These are two different classes and the main is in Game.</p>
  <pre><code>import java.util.ArrayList;
  import java.util.List;
  
  public Class Game{
  
  private List&lt;Player&gt; players;
  
      public Game(){
      players = new ArrayList&lt;&gt;();
  
      players.add(new Player(&quot;Random Name&quot;, 20));
      players.add(new Player(&quot;Random NameTwo&quot;, 200));
  
      }
  
  }
  
  
  public Class Player{
      private List&lt;&gt; hoursPlayed = new ArrayList&lt;&gt;();
      private String name;
      private int playerNumber; 
  
      public Player(String name, int playerNumber){
      this.name = name;
      this.playerNumber = number;
  
     }
  }
  </code></pre>
  <p>If you have any questions let me know :)</p>