why am I getting a java.lang.NullPointerException error?
<p>I have been trying to solve a java.lang.NullPointerException for the past hour. This error occurs when I invoke the play() method and input no. I have commented where the error points to down below. I would appreciate some assistance. Thanks.</p>

<pre><code>import java.util.ArrayList;


public class Game
{
private InputReader input ;
private Deck newDeck;
private ArrayList &lt;Card&gt; hand;


public Game(Deck deckToAdd)
{
    input = new InputReader();
    newDeck = deckToAdd;
    hand = new ArrayList &lt;Card&gt;();
}


public void dealCard()
{

    hand.add(newDeck.takeCard());
}

public void showHand()
{
    for(Card showCards: hand){
        if(hand == null){
          System.out.println("(Warning, the deck may have been empty the last time you dealt a      card)");
        }
          System.out.println(showCards.getDescription() + " of " + showCards.getSuit()); 
         //  Error points to above line
    }
}


public int getHandValue()
{
    int counter = 0;
    int handValue = 0;
    while(counter &lt; hand.size()){
        Card checker = hand.get(counter);
        handValue += checker.getValue();
        counter++;
    }
    return handValue;
}

public void play()      //Error occurs when invoking this method and selecing no, points to showHand() method                                 
{
    boolean userWantsToPlay = true;
    while(userWantsToPlay){
        dealCard();
        showHand();
        System.out.println("Hand Value : " + getHandValue());
        System.out.println("Do you want to continue? (yes or no)");
        String userInput = input.getInput();
        if(userInput == "no"){
            userWantsToPlay = false;
        }
    }

}
}
</code></pre>
