Java java.util Random fields, constructors, methods, implement or subclass

Example usage for Java java.util Random fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for java.util Random.

The text is from its open source code.

Subclass

java.util.Random has subclasses.
Click this link to see all its subclasses.

Constructor

Random()
Creates a new random number generator.
Random(long seed)
Creates a new random number generator using a single long seed.

Method

DoubleStreamdoubles(long streamSize)
Returns a stream producing the given streamSize number of pseudorandom double values, each between zero (inclusive) and one (exclusive).
DoubleStreamdoubles(double randomNumberOrigin, double randomNumberBound)
Returns an effectively unlimited stream of pseudorandom double values, each conforming to the given origin (inclusive) and bound (exclusive).
DoubleStreamdoubles()
Returns an effectively unlimited stream of pseudorandom double values, each between zero (inclusive) and one (exclusive).
ClassgetClass()
Returns the runtime class of this Object .
IntStreamints(int randomNumberOrigin, int randomNumberBound)
Returns an effectively unlimited stream of pseudorandom int values, each conforming to the given origin (inclusive) and bound (exclusive).
IntStreamints()
Returns an effectively unlimited stream of pseudorandom int values.
LongStreamlongs(long randomNumberOrigin, long randomNumberBound)
Returns an effectively unlimited stream of pseudorandom long values, each conforming to the given origin (inclusive) and bound (exclusive).
booleannextBoolean()
Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.
voidnextBytes(byte[] bytes)
Generates random bytes and places them into a user-supplied byte array.
doublenextDouble()
Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.
floatnextFloat()
Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.
doublenextGaussian()
Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.
intnextInt(int bound)
Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.
intnextInt()
Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.
longnextLong()
Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.
voidsetSeed(long seed)
Sets the seed of this random number generator using a single long seed.
StringtoString()
Returns a string representation of the object.