if(tempCard.getSuitValue() == PlayingCard.CLUBS || tempCard.getSuitValue() == PlayingCard.SPADES)
this is the line that is giving me a NullPointerException
PlayingCard redCard, blackCard, tempCard;
tempCard is declared as a varible of object PlayingCard
public PlayingCard(int newFace, int newSuit)
{
faceValue = newFace;
suitValue = newSuit;
}
this is the constructor for object PlayingCard, as well as the parameters for it
public int getFaceValue()
{
return faceValue;
}
public int getSuitValue()
{
return suitValue;
}
these methods give values to the getSuitValue method used in the statement at the very top
public final static int CLUBS = 0;
public final static int DIAMONDS = 1;
public final static int HEARTS = 2;
public final static int SPADES = 3;
these are the constant values for the cards in the deck.
I have gone through every method and constructor that is used in the line that results in the NullPointerException. If anyone wants to see all 4 classes, I can post them at their request.