1import java.util.Random;
2
3Random rand = new Random();
4int random_integer = rand.nextInt(upperbound-lowerbound) + lowerbound;
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