Hi

really I can not get what this part of a code mean and what is the usage of that,thanks

Code:`setSeed(System.currentTimeMillis);`

Printable View

- 06-01-2010, 08:17 AMmatin1234setSeed method of Random class
Hi

really I can not get what this part of a code mean and what is the usage of that,thanks

Code:`setSeed(System.currentTimeMillis);`

- 06-01-2010, 08:56 AMmasijade
To change the basis from which the "random" numbers will be "generated".

- 06-01-2010, 03:18 PMNorm
A random number generator is just a bunch of equations that take a starting number(seed) and compute a new number and save that number as seed for the next request. If it always starts at the same starting number/seed, it will always generate the same series of numbers. If it starts with a different number/seed it will generate a different series of numbers.

The system clock is one way to give the generator a new/unique starting number.