title: assigning variables in a file to an array
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/7669571/printing-a-list-in-java">Printing a list in java</a>  </p>
  </blockquote>
  
  
  
  <p>I have different variables in a file that I need to assign to different variable arrays.  Here is what is in the file:</p>
  
  <pre><code>Lee Keith Austin Kacie Jason Sherri     Jordan     Corey Reginald Brian Taray 
  Christopher Randy Henry Jeremy Robert    Joshua   Robert   Eileen 
  Cassandra Albert Russell   Ethan   Cameron Tyler Alex Kentrell  rederic
  10 20 100 80 25 35 15 10 45 55 200 300 110 120 111 7 27 97 17 37 
  21 91 81 71 16 23 33 45
  A  b  c w e r t q I u y b G J K S A p o m b v x K F s q w
  11.5 29.9 100  200 115.1 33.3 44.4 99.9 100.75 12.2 13.1 20.3 55.5 77.7
  12.1 7.1  8.2   9.9   100.1  22.2  66.6 9.9  1.25     3.75   19.9  3.321  45.54 88.8
  </code></pre>
  
  <p>And here is my code:</p>
  
  <pre><code>import java.util.*;
  public class Prog5Methods{
  public Prog5Methods(){
  }
      public void ReadFromFile(Scanner input, String [] names, int [] numbers, char [] letters, double [] num2){
          System.out.println("\nReading from a file...\n");
          System.out.println("\nDONE\n");
          int r = 0;
              while(input.hasNext()){
                  names[r] = input.next();
                  numbers[r] = input.nextInt();
                  letters[r] = input.next().charAt(0);
                  num2[r] = input.nextDouble();
                  r++;
          }
  } // end of readFromFile
  </code></pre>
  
  <p>I am getting an IndexOutOfBounds exception every time.  How can I assign these types to these arrays?</p>