title: NullPointerException in array.length Java
body: <p>I've been getting an NPE whenever I try to access my array. Even calling for the .length attribute gives me an NPE. Any help would be appreciated. Here is my constructor and the method that keeps failing.</p>
  <pre><code>public SkierList() {
      Skier[] skiers= new Skier[INITIAL_CAP];
      for (int i = 0; i &lt; skiers.length; i++){
          skiers[i] = new Skier(&quot;&quot;);
      }
      int count = 0;
      
  }
  
  public void add(Skier newSkier) {   
      if (this.size() &lt; skiers.length)
      {
          skiers[count] = new Skier(newSkier.getName(), newSkier.getLevel());
          count++;
      }
  }
  </code></pre>
  <p>The code compiles but throws the NPE at skiers.length</p>