Check out example codes for "como limitar o random em java". It will help you in understanding the concepts better.

Code Example 1

int numero = (int)(Math.random()*(X-Y+1)+Y;
int numero = (int)(Math.random()*(75-25+1)+25);

Learn ReactJs, React Native from akashmittal.com