java.util.Random
| |||
The
The algorithm used is good enough for games. I wouldn't use it for cryptography. You can choose the seed or you can let Java pick one based on the current time.
The nextInt() , nextLong() , and nextBytes()
methods all cover their respective ranges with equal likelihood. For
example, to simulate a six-sided die; that is to generate a random integer
between 1 and 6, you might write
The nextGaussian() method returns a
pseudo-random, Gaussian distributed, double value with mean 0.0 and
standard deviation 1.0.
The
| |||
|