title: Java read file and store text in an array
body: <p>I know how to read a file with <code>Java</code> using <code>Scanner</code> and File IOException, but the only thing I don't know is how to store the text in the files as an array. </p>
  
  <p>Here is a <code>snippet</code> of my code:</p>
  
  <pre><code> public static void main(String[] args) throws IOException{
      // TODO code application logic here
  
      // // read KeyWestTemp.txt
  
      // create token1
      String token1 = "";
  
      // for-each loop for calculating heat index of May - October
  
  
      // create Scanner inFile1
      Scanner inFile1 = new Scanner(new File("KeyWestTemp.txt"));
  
      // while loop
      while(inFile1.hasNext()){
  
          // how can I create array from text read?
  
          // find next line
          token1 = inFile1.nextLine();
  </code></pre>
  
  <p>Here is what my <code>KeyWestTemp.txt</code> file contains:</p>
  
  <pre><code>70.3,   70.8,   73.8,   77.0,   80.7,   83.4,   84.5,   84.4,   83.4,   80.2,   76.3,   72.0   
  </code></pre>