Here you can find the source of shuffleList(List> list)
Parameter | Description |
---|---|
list | the list to shuffle |
public static void shuffleList(List<?> list)
//package com.java2s; import java.util.Collections; import java.util.List; import java.util.Random; public class Main { /**/*from w ww.ja va 2 s. co m*/ * Shuffles a list. * @param list the list to shuffle */ public static void shuffleList(List<?> list) { long seed = System.nanoTime(); Collections.shuffle(list, new Random(seed)); } }