title: Cannot find symbol - Split method (Java)
body: <p>So here's the problem: I'm trying to make my code simple. I'm reading from a file that has multiple data items in one line, so I'd like to split them up and put them in the corresponding array. However, the IDE keeps telling me it cannot find the symbol. I've already tried importing the string class (right word?) and moving my element array to within the WHILE loop.</p>
  <p>What am I doing wrong?</p>
  <pre><code>import java.util.Scanner;
  import java.io.File;
  import java.io.IOException;
  import java.lang.String; 
  public class Hurricanes2
  {
  
  public static void main(String [] args) throws IOException 
  {
  int counter = 0;
  String [] token = new String[64];
  
  String [] hurrcaneYear = new String[64];
  String [] hurrcaneName = new String[64];
  int []  hurricaneCategory = new int[64];
  double [] hurrcanePressure = new double[64];
  double tempKnots;
  double knotsToMph; 
  double [] hurricaneWindSpeeds = new double[64];
  double categoryAverage;
  double pressureAverage;
  double speedAverage; 
  String headerData = &quot;                          Hurricanes 1980 - 2006\n\n Year        Hurricane       Category        Pressure(MB)        Wind Speed  (MPH)\n========================================================================&quot;;
  Scanner in = new Scanner(System.in);
  Scanner inFile = new Scanner(new File(&quot;hurcData2.txt&quot;));
  System.out.print(headerData);
  
  /**---Use for-each (line:token) 
   * Parse for year - &gt; year array
   * parse for name - &gt; name array
   * parse for knots - &gt; tempKnots
   * knotsToMph = tempKnots  * 1.15078
   * hurricaneWindSpeed[counter] = knotsToMph
   *  enter if-else to calculate category (hurricaneCategory [] = 1,2,3,4, or 5):
   *      74-95 cat1 
   *      96-110 cat2
   *      111 - 129 cat3
   *      130-156 cat4
   *      157 or higher cat 5
   * 
   * 
   */
  while(inFile.hasNext()) 
  {
      token[counter] = in.nextLine();
      String tokenElements[] = token.split(&quot; &quot;);
      counter++;
  }
  for(String line:token) 
  {
  
  }
  }
  
  }
  </code></pre>