J
John B. Matthews
guptan said:class RNG
{
private Random random;
public RNG() {
random = new Random(System.currentTimeMillis());
}
...
}
Depending on your processor speed and clock resolution, repeated use of
this constructor may result in identically seeded generators. The
no-parameter constructor already "sets the seed of the random number
generator to a value very likely to be distinct from any other
invocation of this constructor."
random = new Random();
<http://java.sun.com/javase/6/docs/api/java/util/Random.html#Random()>