hi please help to print character form a-z and 0-9 randamly in java all the character sholud be present without repetion ie all 26+10 letter sholud print and each time it sholud print differently like First time if it print like this 0 a 2 f g t h y j q 3 v ......
next time f r v c 3 b 5 h 6 j 6................like this
please help me to get this type of result... and i want to store that in a table using Applet

Recommended Answers

All 3 Replies

Make an arraylist with all the individual items.

Generate a random number (not larger than the current size of the arraylist) and get then remove that index from the arraylist. Repeat.

thanks its working now

String[] str={"a","y","z","0","1","2","3","4"};
List<String> list=new ArrayList(Arrays.asList(str));
System.out.println( Collections.shuffle(list));

u wil get the out put each time differntly....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.