I essentially have a deck of 52 cards and wanted to know how to deal the cards to 4 hands. For example so that if it were a real game of cards and each player had a hand, their hand would have 52/4 (13) cards.
I have created the deck and hand classes and produced the constructors so they are initialised properly, but how would I use iterators to deal each card to each hand in turn
I have looked at iterators and could not figure out an appropriate application
Below are the constructors of classes deck and hand
private ArrayList<Card> deck;
public Deck() {
deck = new ArrayList<>(52);
for (int i = 0; i < 52; i++)
deck.add(new Card(value, suit);
}
private ArrayList<Card> hand;
public Hand() {
hand = new ArrayList<>();
}