Looks like you have an array or List
field inside CardStack
to store the elements that will behave as a stack structure. Make sure this field is not static
, otherwise it will be bound to the class, and all instances of the class will share the same array, List
or whatever object it is.
More info: