
public class RandomShuffle
{
    public static void main(String[] args)
    {
        double[] myList = { 1, 2, 3, 4, 5, 6, 7};

        // Random suffle on array myList
        for ( int i = 0; i < myList.length; i++ )
        {
            int j = (int)(Math.random() * myList.length);
          
            // swap myList[i] and myList[j]
            double temp = myList[i];
            myList[i] = myList[j];
            myList[j] = temp;
        }
        
        for ( int i = 0; i < myList.length; i++ )
            System.out.print(myList[i] + "  ");
    }
}
