I have a slight problem right now.
Currently I have two classes. One called CardList and another called Trick.
The CardList is what it sounds like, it is an object that declares itself as an arraylist and had multiple methods in it one that is add. Trick is supposed to be an CardList and extends the CardList class.
private CardList aTrick;
private Suit trumpSuit;
public Trick(Bid pContract)
{
aTrick = new CardList();
this.trumpSuit = pContract.getSuit();
}
At the moment, whenever I use the add method within Trick, the CardList remains empty.
For example.
trick = new Trick(new Bid(7, Card.Suit.HEARTS));
trick.add(aJD);
The list remains empty.
Any help would be appreciated.
The add method is within the CardList class.
All it does is add cards normally to an arrayList. Nothing special.
If
Trickis suppose to extendCardListwhy do you have a reference to theCardListin theTrickclass, this is not inheritance…Would be “extending”
CardList