Question: public class Deck { private ArrayList cards; private Random rand; public Deck(int n) { super(); rand = new Random(); cards = new ArrayList (n); for

public class Deck {
private ArrayList
private Random rand;
public Deck(int n) {
super();
rand = new Random();
cards = new ArrayList
for (int suite = 1; suite
for (int rank = 1; rank
if ((suite - 1) * 13 + rank
cards.add(new PlayingCard(rank, suite));
}
}
}
public PlayingCard dealOne() {
return cards.get(rand.nextInt(52));
}
public void shuffle() {
}
public String toString(){
String ret = "";
for (PlayingCard card : cards){
ret += card + " ";
}
return ret;
}
}
Create a method called shuffle_array) in the Deck class which shuffles an array using the method we discussed in in class (sorting an array of random numbers). Do not use the built in Java shuffle methods or any other shuffling algorithm
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
