1Random r = new Random();
2int low = 10;
3int high = 100;
4int result = r.nextInt(high-low) + low;
5
1import java.util.concurrent.ThreadLocalRandom;
2
3// nextInt is normally exclusive of the top value,
4// so add 1 to make it inclusive
5int randomNum = ThreadLocalRandom.current().nextInt(min, max + 1);
6