random number in range java

Java
	(int)(Math.random() * ((max - min) + 1)) + min
Copyint rand = ThreadLocalRandom.current().nextInt(x,y);
Source

Also in Java: