Shuffle the elements in the array : Collections « Collections Data Structure « Java
- Java
- Collections Data Structure
- Collections
Shuffle the elements in the array
import java.util.Arrays;
import java.util.Collections;
public class Main {
public static void main(String[] argv) throws Exception {
String[] array = new String[] { "a", "b", "c" };
Collections.shuffle(Arrays.asList(array));
}
}
Related examples in the same category