If you want to generate random number in Java don’t use :
Random rd = new Random()
It was proved that this class does not generate really random number. The solution is to use the ThreadLocalRandom class.
This is an example :
ThreadLocalRandom random = ThreadLocalRandom.current(); // create a number between 0 and 2 intNextInt = random.nextInt(3);
You can also use it to querying for a number in an interval like this :
intNextInt = random.nextInt(2,5);
See you soon.