16.7.2 Method shuffle
Method shuffle randomly orders a List
’s elements. Chapter 7 presented a card shuffling and dealing simulation that shuffled a deck of cards with a loop. Figure 16.10 uses method shuffle
to shuffle a deck of Card
objects that might be used in a card-game simulator.
Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.