aspose file tools*
The moose likes Beginning Java and the fly likes Shuffleing and array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Shuffleing and array" Watch "Shuffleing and array" New topic
Author

Shuffleing and array

Sally Curtis
Greenhorn

Joined: Jan 10, 2004
Posts: 26
hi, i am writing a black jack program and was wondering how i would shuffle an array that consisted of 52 cards( characters)
chi Lin
Ranch Hand

Joined: Aug 24, 2001
Posts: 348
Collections provides a static shuffle(List lst) method.
Sally Curtis
Greenhorn

Joined: Jan 10, 2004
Posts: 26
how come i keep getting an error ackage Collections does not exist
Collections.shuffle(Array.asList(cards);?
^
chi Lin
Ranch Hand

Joined: Aug 24, 2001
Posts: 348
You need Collections.shuffle(Arrays.asList(cards);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Shuffleing and array