It is not that difficult.
Try using this:
int randomNum = (int) Math.ceil(Math.random() * 100);
For a number from 0 to 100. Or, if you need a value between X and Y, use the following:
int randomNum = (int) Math.ceil(Math.random() * X) + Y;
Where Y is the smallest amount you want and X is the largest number you want to add to it (e.g. Y = 75 and X = 25 so that you get a number from 75 to 100 (75 + 25))
source share