java - Unique Random Integer Generator -


i'm trying make random integer generator produces unique numbers.

does has ideas how's possible?

if have small-enough range of possible numbers, simple , useful:

final list<integer> sack = new arraylist<>(range); (int = 0; < range; i++) sack.add(i); collections.shuffle(sack); 

now pull items out of sack in order.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -