Hi, i only know the Java basics and really need help! I have a class called temporaryHolder which holds an arrayList of 54 cards. However, I need to get elements out of this arraylist and need to add them to stacks in another class.
Q1) How can I access all the elements in this arraylist as I am in another class called
public class pile.
Q2)If the user says I want 3 piles, I can get the user input by the scanner but How do I create the 3 piles(stacks)
for(int i=0; i <3; i++){
Card c = new Stack();
}
This aint working.
Q3) Once the piles have been created, lets say 3. I need to add elements from the arraylist to the piles(stacks) This is what needs to happen.
Pile 1 Pile 2 Pile3
ArrayListElement1 ArrayListElement2 ArrayListElement3
ArrayListElement4 ArrayListElement5 ArrayListElement6
And so on....
I only know the java basics and find this very complicated. I have spent many hours trying to solve this problem but cannot. Can somebody please help?