mercredi 24 février 2016

Unique random - srand in java ? (like in c++)

Currently I'm using a

Random rand = new Random();
myNumber = rand.nextInt((100-0)+1)+0;

and it's a pseudo-random, because I always get the same sequence of numbers. I remember in c++ you could just use the ctime and use srand to make it unique. How do you do it in java ?




Aucun commentaire:

Enregistrer un commentaire