January 2014
Intermediate to advanced
736 pages
70h 43m
English
Method dealCard (lines 49–56) deals one Card in the array. Recall that currentCard indicates the index of the next Card to be dealt (i.e., the Card at the top of the deck). Thus, line 52 compares currentCard to the array’s length. If the deck is not empty (i.e., currentCard is less than 52), line 53 returns the “top” Card and postincrements currentCard to prepare for the next call to dealCard—otherwise, null is returned.
Read now
Unlock full access