A Deck would presumably own a collection of Card objects, and similarly a hand might also be a (smaller) collection of
Cards. A function that scores a hand might look like the following: it adds up the values of each card by calling getValue() on each Card object in the collection. The variable "card" refers to each card in the hand in turn, and this code uses that variable to call Card's methods.
[URL]
public int score(List hand) {
int score = 0;
for (Iterator it = hand.iterator(); it.hasNext()

{
Card card = (Card) it.next();
score += card.getValue();
}
return score;
}
[/code]