How to shuffle an array in java

How to shuffle an array in java
ref‮ re‬to:lautturi.com
/**
 * @author lautturi.com 
 * Java example: shuffle an array in java
 */

import java.util.*;

public class Lautturi {
	
	public static void main(String[] args) {
		Random rand = new Random();
		int[] intArray = { 1,2,3,4,5,6,7,8,9,10 };
		for (int i = 0; i < intArray.length; i++) {
            int randomPosition = rand.nextInt(intArray.length);
            int temp = intArray[i];
            intArray[i] = intArray[randomPosition];
            intArray[randomPosition] = temp;
        }
		System.out.println("shuffle array:"+Arrays.toString(intArray));
	}
}

output:

shuffle array:[3, 4, 6, 9, 1, 8, 10, 7, 2, 5]
Created Time:2017-10-06 13:57:31  Author:lautturi