Sign up ×  I'm writing a code for a deck of cards which shuffles
the deck of cards. I tested the code but I don't really know if
it's actually doing what it's supposed to be doing correctly?
What do you think?  This is the code for the shuffle method:
public void shuffle()     for( int x = myDeck.size(); x > 0 ;
x--)          Random rn = new Random();         int index1 =
rn.nextInt(52);         Card c = myDeck.remove(index1);  My
output seems shuffled in its numbers but not by the name of the
card like spades hearts etc,  For example this is my output when
I test the code :  Deuce of spades Seven of spades Eight of
spades Ace of spades Three of hearts Five of hearts Six of
hearts Seven of hearts Nine of hearts Ten of hearts Queen of
hearts King of hearts Ace of hearts Seven of diamonds Eight of
diamonds Jack of diamonds King of diamonds Three of clubs Seven
of clubs Nine of clubs Jack of clubs Queen of clubs King of
clubs Ace of clubs Queen of spades Deuce of clubs Three of
spades Nine of diamonds Four of s