jeudi 22 septembre 2016

Java Random Number with seed changes after a day

I was using the code below to generate random number with seed so that I can generate back the same results next time.

int seed = 100;    
Random rand = new Random(seed);

I manage to get back the same results from the program on the same day, but after a day or two i get a completely different results. Is there a problem of the way I implement the random seed? Anyone encounter this before?




Aucun commentaire:

Enregistrer un commentaire