/** * @author lautturi.com * Java example: get a random number between lowerbound(inclusive) and upperbound(inclusive) */ import java.util.*; public class Lautturi { public static void main(String args[]) { int lowerbound = 20; int upperbound = 100; Random rand = new Random(); int random_integer = rand.nextInt(upperbound-lowerbound+1) + lowerbound; System.out.println(random_integer); } }