Java tutorial
//package com.java2s; import java.util.Random; public class Main { public static void shuffleArray(int[] array, Random rand) { for (int i = array.length; i > 1; i--) { int b = rand.nextInt(i); if (b != i - 1) { int e = array[i - 1]; array[i - 1] = array[b]; array[b] = e; } } } }