title: Java .split() Array out of bounds
body: <p>I keep getting this Array out of bounds error for the following code.</p>
  
  <p>brock.txt = reflection program, routine, Arrow, snake game, </p>
  
  <pre><code>public static void main(String[] args) {
      String filename = "brock.txt";
      String line; 
      String [] cities = {};
      int x = 0;
      try {
  
      BufferedReader eshread = new BufferedReader( new FileReader (filename));
          line = "";
  
          while ((line = eshread.readLine()) != null ) {
          String[] store = line.split(",");
          System.out.println(store[0]);
          System.out.println(store[1]);
          System.out.println(store[2]);
          cities[x] = store[2];            //&lt; keep getting an error here
          x++;
          }//end while loop
          eshread.close();
          }//end try
      catch(IOException iox) {
      System.out.println("failiure");
      }//end catch
  </code></pre>