Returns a random value chosen from a uniform distribution of the
non-negative integers less than n
, or throws IllegalArgumentException
if n
is negative or zero.
Returns a random value chosen from a uniform distribution of all valid
Int
s.
(Since version ) see corresponding Javadoc for more information.
A random number generator that focuses on speed and lack of inter-thread interference, rather than on the quality of the numbers returned. The
object SimpleRandom
is striped internally to reduce contention when accessed from multiple threads. Theclass SimpleRandom
should only be used by a single thread.The constants in this 64-bit linear congruential random number generator are from http://nuclear.llnl.gov/CNP/rng/rngman/node4.html.