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
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);
To change the basis from which the "random" numbers will be "generated".
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.