How to extract N random different elements from a set of unique elements?

Posted by Roman on Stack Overflow See other posts from Stack Overflow or by Roman
Published on 2010-03-24T09:29:03Z Indexed on 2010/03/24 9:33 UTC
Read the original article Hit count: 172

Filed under:
|
|
|

I have a set of unique elements (there are not two identical elements). And I would like to extract N random and different elements from the set. What is the easiest way to do it in Java?

© Stack Overflow or respective owner

Related posts about java

Related posts about hashset