Generate random numbers using Math.random

The Math.random() function returns a pseudorandom number in the form of a floating point number in the range 0 – 1. However, the range of values can be extended arbitrarily. The random number is determined by the implementation. it cannot be selected or reset by the user.

public class RandomNumbers {
    public static void main(String[] args) {
        System.out.print("Random value between 0 - 9:\t");
        int randomInteger10 = (int) Math.floor(Math.random() * 10);
        System.out.println(randomInteger10);

        System.out.print("Random value between 1 - 10:\t");
        int randomInteger = (int) Math.floor(Math.random() * 10) + 1;
        System.out.println(randomInteger);

        System.out.print("Random value between 0 - 100:\t");
        int randomInteger100 = (int) Math.floor(Math.random() * 101);
        System.out.println(randomInteger100);
    }
}
Output first run
Random value between 0 - 9:     8
Random value between 1 - 10:    8
Random value between 0 - 100:   16
Output second run
Random value between 0 - 9:     9
Random value between 1 - 10:    3
Random value between 0 - 100:   95