Methods of the Random class:
nextInt() returns a random int
nextInt(int bound) returns a random int from 0 (inclusive) to bound(exclusive)
nextDouble() returns a random double from 0 (inclusive) to 1 (exclusive)
You can change the range of the random values, by adding a constant to the random number, or multiplying the random number by a constant.
No comments:
Post a Comment