The Math.random() method can be employed for generating random numbers.
Math.random() yields a random number ranging from 0.0 (inclusive) to 1.0 (exclusive).
Math.random();
|
For greater control over the generated random number, such as limiting it to a range like 0 to 100, you can utilize the following formula:
int |