Hi I am doing a poker game for my project. I have some problems figuring out how to test my contains()
method. I know that you can type .contains("KING of SPADES");
for example but it does not work with my parameter. So what should I write instead? The same problem is with add2
I don't really know how to work with that (how to add a list and how to print it out) so can someone explain?
ArrayList<Card> PileOfCards;
public Pile(){
PileOfCards = new ArrayList<Card>();
}
public void add(Card c){
PileOfCards.add(c);
}
public void add2(List<Card> cards){
PileOfCards.add((Card)cards);
}
public Boolean contains(Card c){
return PileOfCards.contains(c);
}