Random class

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

Searching Algorithms

Linear/Sequential Search A linear/sequential search algorithm looks at each element in the array until it finds what it's looking for. ...