title: String array error
body: <p>I am having an array error, saying it is out of bounds I have no idea what is wrong. Here is my code:</p>
  
  <pre><code>import java.util.*;
  public class gameVar {
      public static int size;
      public static int counter;
      public static Scanner input = new Scanner(System.in);
      public static String currentIn;
      public static String nameArray[] = new String[size];
  }
  </code></pre>
  
  <p>and the second class(where i am getting the error on line 6):</p>
  
  <pre><code>public class mainThread extends gameVar {
  public static void main(String[] args){
      System.out.println("Please type the desired amount of players: ");
      size = input.nextInt();
      for(int counter = 0; counter &lt; size; counter++){
          System.out.println("Please enter the name of player " + nameArray[counter])
          }
      }
  }
  </code></pre>
  
  <p>Your help is much appreciated!</p>