I have tried so many things, I am now thorougly confussed. I am trying to make an array of Stacks that will contain objects called Card. I need 17 stacks of cards. The currentDeck.dealSingleCard() returns a Card object.
Here's my last stab that gives me the error message no suitable method found for add. I've tried with ArrayList, but that gives me an error message about generics. Surely there is an easy way to create a bunch of stacks withouth having to give each one an separate name..... Help :-)
List<Stack<Card>> piles = new List<Stack<Card>>();
for (int i = 0; i < 17; i++)
{
piles.add(i) = ( new Stack <Card>() );
}
for (int i = 0; i < 7; i++)
{
piles.get(i) = piles.get(i).push(currentDeck.dealSingleCard());
}