title: How to use string tokenizer on an array?
body: <p>I see that you can't use string tokenizer on an array because you cant convert <code>String()</code> to <code>String[]</code>.  After a length of time I realized that if the inputFromFile method reads it line by line, I can tokenize it line by line.  I just don't know how to do it so that it returns the tokenized version of it.</p>
  
  <p>I'm assuming in the <code>line=in.ReadLine();</code> line I should put <code>StringTokenizer token = new StringTokenizer(line,",")</code>.. but it doesn't seem to be working.</p>
  
  <p>Any help?  (I have to tokenize the commas).</p>
  
  <pre><code>public class Project1 {
  
      private static int inputFromFile(String filename, String[] wordArray) {
          TextFileInput in = new TextFileInput(filename);
          int lengthFilled = 0;
          String line = in.readLine();
          while (lengthFilled &lt; wordArray.length &amp;&amp; line != null) {
              wordArray[lengthFilled++] = line;
              line = in.readLine();
          }// while
          if (line != null) {
              System.out.println("File contains too many Strings.");
              System.out.println("This program can process only "
                      + wordArray.length + " Strings.");
              System.exit(1);
          } // if
          in.close();
          return lengthFilled;
      } // method inputFromFile
  
      public static void main(String[] args) {
          String[] numArray = new String[100];
          inputFromFile("input1.txt", numArray);
          for (int i = 0; i &lt; numArray.length; i++) {
              if (numArray[i] == null) {
                  break;
              }
              System.out.println(numArray[i]);
          }// for
  
          for (int i=0;i&lt;numArray.length;i++)
          {
              Integer.parseInt(numArray[i]);
          }
  
      }// main
  }// project1
  </code></pre>