jeudi 9 juillet 2015

What is the use of the Random(long) constructor?

There are 2 constructors of Random class

  1. public Random()
  2. public Random(long seed)

The description for the second constructor as per oracle states as

Creates a new random number generator using a single long seed. The seed is the initial value of the internal state of the pseudorandom number generator which is maintained by method next(int).

I did not understand it completely. And I did not find any articles/book which clearly explains why,when and how it is used.

Can any one explain please?




Aucun commentaire:

Enregistrer un commentaire