Need help programming a word game
<p>I am getting an error message in Eclipse:</p>

<blockquote>
  <p>The type of the expression must be an array type but it resolved to Player.</p>
</blockquote>

<p>I have created an object Player.  The user through the JOptionPane enters how many players they want.  I am trying to store the players names in an array.</p>

<pre><code> public class Project3 {
 public static void main(String[] args){

  String input = JOptionPane.showInputDialog("Enter the number of players: ");
  int numPlayers = Integer.parseInt(input);
  Player nameOfPlayers;

  for(int i = 0; i &lt; numPlayers; i++){
   nameOfPlayers[i] = new Player(JOptionPane.showInputDialog("Enter the number of players: "));
   if (input == null || input.equals(" ")) throw new IllegalArgumentException("Must enter valid name!!!");

  }

 }
</code></pre>

<p>Here's is my Class Player:</p>

<pre><code>public class Player {
 private String name;

 public Player(String name){
  if(name == null || name.equals(" "))
   throw new IllegalArgumentException("Must enter a name. ");

  this.name = name;

 }


 public void addWord(Word w){

 }
 public int getScore(){

 }
}
</code></pre>
