Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

making a deck of cards and shuffling them in a linked list

807589Sep 10 2008 — edited Sep 11 2008
hi all im creating a deck of playing cards for a game of blackjack and so far im creating the deck of cards and using a linked list and wanted to know if i was on the right track and maybe get some suggestions on how to add the cards that are created to the deck and then shuffle them thanks.

public class Deck extends LinkedList <Card>
{private int cardPos = 0
public Deck()
{

for (int card = 1; card <= 13; card ++)
{ for ( Suit suit: Suit.values())
new Card(card, suit)
}}}

am i on the right track in creating cards and storing them to the list?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 9 2008
Added on Sep 10 2008
6 comments
1,421 views