title: Cannot invoke add on the array type
body: <p>I have been given some code to tinker with, which is a prisoners dilema game are initially the players were set with this piece of code into an array.</p>
  
  <pre><code>IPDPlayer[] currentPlayers = { new RandomPlayer(),  
                                      new TFTPlayer(),  new TFTPlayer(), new TFTPlayer(), 
                                      new CoopPlayer(), new CoopPlayer(), new CoopPlayer(),
                                      new UncoopPlayer(), new UncoopPlayer(), new UncoopPlayer()};
  </code></pre>
  
  <p>I'm  trying to replace this with:</p>
  
  <pre><code>IPDPlayer[] currentPlayers = {};
  Scanner sc1 = new Scanner(System.in);
  System.out.println(" How many Tit-for-Tat?");
  int in_value = sc1.nextInt();
  for(int x = 0; x &lt; in_value; x++)
  {
      currentPlayers.add(new TFTPlayer());
  }
  </code></pre>
  
  <p>As a way of choosing the number and type of players once the program has begun. However I simply get the error 
  "Cannot invoke add(TFTPlayer) on the array type IPDPlayer[]"</p>