You're welcome and best of luck!
Type: Posts; User: curmudgeon
You're welcome and best of luck!
You seem to be calling get on an ArrayList and then trying to set that equal to a stack. That's not how ArrayLists or the get() method works. Why not instead simply call add(...) on the ArrayList if...
Where *exactly* was the error? Which line?
You appear to be trying to call clear() on Stacks that don't yet exist. You do this 17 times on an *empty* List of Stacks.
There's nothing preventing you from creating an ArrayList<Stack<Card>> or a List<Stack<Card>>.
For example, this will compile just fine:
List<Stack<String>> myStrStackList = new...
Yes you did. Sorry about that.
Please post the entire error message.
Likely though your problem is due to the limitations of Java generics including type erasure and that Java generics are not covariant. To read more on this,...