title: how can i create an array of objects filled by the user and view the array elements?
body: <p>I created a method to create an array of objects that will be filled by the user and another method to show the filled array. I'm having problems viewing the array and I can't figure out what's wrong.</p>
  
  <pre><code>public void addPlayer() {
      for (int i = 0; i &lt; 11; i++) {
          System.out.println("player  " + (i + 1));
          System.out.println("Name:");
          String name = scan.next();
          System.out.println("Sweater number:");
          int sNr = scan.nextInt();
          System.out.println("Card (red,null,yellow)");
          String card = scan.next();
          players[i]=new Player(name,sNr,card);
      }
  }
  </code></pre>