title: Exception in thread "main" java.lang.NullPointerException? What does this mean?
body: <p>I have an error when trying to run this program. This is not the entire program just the few details I think where the problem is. The error points out  </p>
  
  <pre><code>if(board[randSpace].isEmpty())  and 
  cl.makeChutes(5);"
  </code></pre>
  
  <p>Error is :</p>
  
  <pre><code>"Exception in thread "main" java.lang.NullPointerException
  at ChutesAndLadders.makeChutes(ChutesAndLadders.java:29)
  at ChutesAndLadders.main(ChutesAndLadders.java:67)"
  </code></pre>
  
  <p>This is my program:</p>
  
  <pre><code>import java.util.Random;
  public class ChutesAndLadders{
  
  Cell [] board = new Cell [100];
  Random rand = new Random ();
  public int chutes, ladders;
  
  public void makeChutes (int a ){
      int makeChutes = a;
      for (int i = 0; i &lt; a; i++){
          int randSpace = rand.nextInt(99);
          if(board[randSpace].isEmpty())
              board[randSpace] = new Cell (-10,"C");
          else 
              i--;
      }
  }
  
   public static void main(String[] args) {
   // Create an instance of ChutesAndLadders
   ChutesAndLadders cl = new ChutesAndLadders(10,10);
  
   // Randomly place 5 more chutes and 5 more ladders
   cl.makeChutes(5);
   cl.makeLadders(5);
  </code></pre>
  
  <p>Here is my isEmpty:
          public boolean isEmpty(){
          for(int i = 0; i &lt; board.length; i++)
          {
              if (board[i].isEmpty())
                  return true;
          }
          return false;
      }</p>
  
  <p>I could be entirely wrong on my coding. I'm still learning so please be patient. Thank you!</p>