vendredi 28 août 2015

Using Random Number Generator with Current Time vs Without

I want to understand what the difference is between using a Random number generator, setting System.currentTimeMillis() as the seed, and just using the default constructor. That is, what is the difference between this:

Random rand = new Random(System.currentTimeMillis());

and this:

Random rand = new Random();

I know that the numbers are pseudo-random, but I am yet to fully understand the details, and how they come about, between the level of 'randomness' one gets when current time is used as seed, and when the default constructor is used.




Aucun commentaire:

Enregistrer un commentaire