I have this code:
Random r = new Random();
while (mStack[step].hasNext()) {
int rand = r.nextInt(length);
for (int i = rand; i < length+rand; i++) {
//use of i and rand
}
}
and all this in a recursive call.
Will this seed a new Random for each while iteration, different for each recursive call?
Or I have to use
while (mStack[step].hasNext()) {
Random r = new Random();
int rand = r.nextInt(length);
for (int i = rand; i < length+rand; i++) {
//use of i and rand
}
}
Please advice