Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How good is the Collections.shuffle() method?

807597Jan 12 2005 — edited Jan 13 2005
Hello
I have an ArrayList which I want to bootstrap from. I did not find any method to randomly select an entry from the ArrayList, so I use the shuffle method first, and then get the first entry (which should be random after each shuffle). However, I do get some strange results from this. On average the numbers gotten when I sample small series is lower then the ones I get sampling longer series. There is no aspect with the data that should imply such behavoiur. Does anyone know how good my way of sampling is (using shuffle), and if the shuffle method really is a good way to randomize?


Regards
JT
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 10 2005
Added on Jan 12 2005
4 comments
417 views