title: It kept saying java.lang.nullpointerxception. Being trying to figure out what is is. Help Anyone?
body: <p>Been trying to figure out what is wrong with the code. Is there anything that i'm not doing it right ? </p>
  
  <p>public class deck2 {
      public Card[] deck;</p>
  
  <pre><code>public void CreateDeck() {
      String[] suit = { "Spades", "Hearts", "Diamonds", "Clubs" };//Array for suit
      int[] number = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }; // Array for rank
  
      for (int i = 0; i &lt;suit.length ; i++) {//Looping the suit array
          for (int n = 0; n &lt; number.length; n++) { // Looping the number array
              Card c = new Card(suit[i], number[i]); //Calling the constructor from my card class
              if (deck[i] == null) {
                  deck[i] = c;
  
  
              }
  
          }
  
      }
  
  }
  
  public void displayDeck() {
      for (int i = 0; i &lt;deck.length; i++) {
          if (deck[i] != null) {
              deck[i].display(); // Calling the display method from my card class. 
          }
      }
  
  }
  </code></pre>
  
  <p>}</p>