title: Getting NPE on an Instantiated Array of booleans
body: <p>Alright, I've been getting a NPE that I can't figure out and it's driving me absolutely batty. I've got a linked list of Reservation objects and a 2d array of booleans to keep track of the available seats:</p>
  
  <pre><code>class ResList
  {
      private Reservation head;
      private boolean [][] seats;
  
      ResList()
      {
          head = null; //empty list
          boolean[][] seats = new boolean[5][25];
      }
  </code></pre>
  
  <p>I've also got a method isAvailable() to determine whether a seat is available:</p>
  
  <pre><code>boolean isAvailable(int f, int s)
      {        
          if(f&lt;0 || f&gt;4 || s &lt; 0 || s &gt; 24)
              return false;
          else
              return !seats[f][s]; // this line throws the NPE
      }
  </code></pre>
  
  <p>But when I do this:</p>
  
  <pre><code>jcbSeat = new JComboBox();        
          for(int i = start; i &lt;= stop; i++)
          {        
              if(list.isAvailable(selectedFlight, i))
                  jcbSeat.addItem(i+1);
          }
  </code></pre>
  
  <p>I get a NPE where noted. I added some debugging lines to the ResList constructor, and can access seats[][] there just fine, but when I execute the method, ka-boom: NPE. What is going on here?</p>