Lets have the following sample:
import java.util.*;
public class MyClass {
public static void main(String args[]) {
Random rnd = new Random();
rnd.setSeed(45);
float v = rnd.nextFloat();
v = rnd.nextFloat();
v = rnd.nextFloat();
v = rnd.nextFloat();
v = rnd.nextFloat();
float expectedNext = rnd.nextFloat();
float nextSeend = ???;
rnd.setSeed(nextSeend);
v = rnd.nextFloat();
System.out.println("expected=" + expectedNext + " result=" + v);
}
}
I'm looking for a way to have: expectedNext = v
It means that I'm looking to continue the same sequence (without replaying the 5x nextFloat).
Aucun commentaire:
Enregistrer un commentaire