The method {@code nextInt} is implemented by class {@code Random}as if by:
{@code}public int nextInt() return next(32); }}@return the next pseudorandom, uniformly distributed {@code int}value from this random number generator's sequence
An invocation of this method of the form nextInt() behaves in exactly the same way as the invocation nextInt(radix), where radix
is the default radix of this scanner.
@return the int scanned from the input
@throws InputMismatchException if the next token does not match the Integer regular expression, or is out of range
@throws NoSuchElementException if input is exhausted
@throws IllegalStateException if this scanner is closed
lower
and upper
(endpoints included). The generated integer will be random, but not cryptographically secure. To generate cryptographically secure integer sequences, use nextSecureInt
.
Preconditions:
lower < upper
(otherwise an IllegalArgumentException is thrown.)lower
and less than or equal to upper
.
lower
and upper
, inclusive.
@param lower the lower bound.
@param upper the upper bound.
@return the random integer.
@throws NumberIsTooLargeException if {@code lower >= upper}.
int
value from this random number generator's sequence. All 232 possible {@code int} valuesshould be produced with (approximately) equal probability.
@return the next pseudorandom, uniformly distributed int
value from this random number generator's sequence
The generated integer will be random, but not cryptographically secure. To generate cryptographically secure integer sequences, use {@link #nextSecureInt(int,int)}.
@param lower lower bound for generated integer @param upper upper bound for generated integer @return a random integer greater than or equal to {@code lower}and less than or equal to {@code upper} @throws NumberIsTooLargeException if {@code lower >= upper}int
value from this random number generator's sequence. All 232 possible {@code int} valuesshould be produced with (approximately) equal probability.
@return the next pseudorandom, uniformly distributed int
value from this random number generator's sequence
int
value from this random number generator's sequence. All 232 possible {@code int} valuesshould be produced with (approximately) equal probability.
@return the next pseudorandom, uniformly distributed int
value from this random number generator's sequence
int
value from this random number generator's sequence. All 232 possible {@code int} valuesshould be produced with (approximately) equal probability.
@return the next pseudorandom, uniformly distributed int
value from this random number generator's sequence
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|