title: Receiving IndexOutOfBoundsException
body: <p>When using the below code i receive this error: Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 25. Yet, I certainly declared the Player array. Any ideas why?</p>
  
  <p>UPDATE:
  Sorry it seems I never explained clearly:
  There are 2 arrays present below, the Team[24] consists of 24 teams BUT, each team, has an entire Player[25] array as one of its attributes (with 25 players). The error, I am receiving, therefore, is not related to the Team[24] array but rather with the Player[25] array which does indeed have 25 elements. </p>
  
  <pre><code>private Team [] teamArr = new Team[24];
  private int size = 0;
  
  public TeamArr()
  {
    String line, player, position, team;
    int ranking;
    double points;
    char group;
    Player [] playerArr = new Player[25];
    int sizeTeam = 0;
  
    try
    {
       Scanner inFile = new Scanner(new File("FIFA.txt"));
       while (inFile.hasNext())
       {
          line = inFile.nextLine();
          //System.out.println(line);
          Scanner sc = new Scanner(line).useDelimiter("#");
          ranking = sc.nextInt();
          team = sc.next();
          points = sc.nextDouble();
          group = sc.next().charAt(0);
          while (sc.hasNext())
          {
             player = sc.next();
             position = sc.next();
             playerArr[sizeTeam] = new Player(player, position);
             sizeTeam++;
          }//while sc
          teamArr[size] = new Team(team, playerArr, sizeTeam, group, ranking,points);
          size++;
          sc.close();
       }//end while inFile
       inFile.close();
    }
    catch(IOException ex)
    {
       System.out.println("error in constructor " + ex);
    }
  
    }//end constructor
  </code></pre>