I have an issue ,trying to build a unique number generator.
Specifiacally, the generator is this
Code:
Random randomPerson=new Random(System.nanoTime());
int no_persons=persons.length;
int cnt=0;
while(cnt<70) {
int person=randomPerson.nextInt(no_persons);
if(function()) {
cnt++;}
When this program is executed, I either take the aprropriate output, or the program stucks (infinite loop). Is there any possibility to fix this infinite loop?
Thanks in advace!
