Online Java Compiler By
JavaTpoint.com
import java.util.*; public class CollectionsShuffleExample4 { public static void main(String[] args) { List
list = Arrays.asList("one", "two", "three", "four"); System.out.println(list); Collections.shuffle(list, new Random(2)); System.out.println(list); } }
Output