a_b's approach sounds good, but if you want to continue to utilize the Arrays collection with the Arrays.sort(T[], Comparator<T>) overload. You can have your custom Comparator utilize Random in some fashion like taking the hashcode of the Student class and multiply by some random value that you can make larger than array length if you want since you are not using as index but just a means to generate numbers that can then be compared for random sorting.
Kevin
Main Topics
Browse All Topics





by: a_bPosted on 2009-11-05 at 21:30:24ID: 25756789
Here is someone who tried to do the samething - http://www.experts-exchang e.com/Prog ramming/La nguages/Pa scal/ Delph i/Q_215690 43.html
Pseudo code -
Pick 2 random numbers (min = 0 , max = array size)
Swap the indexes.