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)); } }