title: Read file then store in array without using arraylist java
body: <p>I am trying to read a file with 8 columns of data and store each string of data into an array, but I keep getting cannot find symbol error for employee.length. I put 8 elements for each string within the row. Please help me by explaining what I am doing wrong. Code:</p>
  
  <p>Scanner scan = new Scanner(new FileReader ("payrollData.dat"));</p>
  
  <pre><code>    String employee[] = new String[8];
  
      while(scan.hasNext())
      {   
          for(int i = 0; i &lt; employee.length(); i++)
          {
              employee[i] = scan.next();
          }
      }
  
      System.out.println(employee);8
  </code></pre>