public final class RandomDefault extends Object implements RandomNumberGenerator
Constructor and Description |
---|
RandomDefault()
Initializes a new instance of the
RandomDefault class, using a seed generated from the system clock. |
RandomDefault(int seed)
Initializes a new instance of the
RandomDefault class, with a specified seed. |
Modifier and Type | Method and Description |
---|---|
double |
nextDouble()
Generates a random floating-point number that is greater than or equal to 0.0, and less than 1.0.
|
int |
nextInt(int minValue,
int maxValue)
Generates a random integer between [minValue..maxValue).
|
public RandomDefault()
RandomDefault
class, using a seed generated from the system clock.public RandomDefault(int seed)
RandomDefault
class, with a specified seed.public double nextDouble()
nextDouble
in interface RandomNumberGenerator
public int nextInt(int minValue, int maxValue)
nextInt
in interface RandomNumberGenerator
minValue
- the least legal value for the Random number.maxValue
- One greater than the greatest legal return value.Copyright © 2023. All rights reserved.