java random number in range

Java
int max = 7; //max range
int min = 3; //min range
int a = new Random().nextInt(min,max); //generates a number between min and maxint rand = ThreadLocalRandom.current().nextInt(x,y);
Source

Also in Java: