java.util · java.base · since Java 1.0
Random
public class Random implements RandomGenerator, SerializableSeedable pseudo-random generator — reproducible sequences for tests and simulations. For concurrent code use ThreadLocalRandom; for security use SecureRandom.
Key methods
Random(long seed) | Deterministic sequence — reproducible tests. |
int nextInt(int origin, int bound) | Uniform in [origin, bound). |
IntStream ints(long size, int origin, int bound) | Random streams. |