Check out example codes for "java random number generator in range". It will help you in understanding the concepts better.

Code Example 1

int rand = ThreadLocalRandom.current().nextInt(x,y);

Learn ReactJs, React Native from akashmittal.com