I'd like to ask how should I implement a method in Java that takes all the elements from an array and shuffle them. Think like a deck of playing cards.
This is my try:
// a is an array of type String
public void randomize()
{
for(int i=0; i<k; ++i)
{
int idx = new Random().nextInt(k);
String random = (a[idx]);
System.out.println(random);
}
}