import java.util.Random; public class RandomNumInRange { public static void main(String[] args) { int min = 10; int max = 20; Random rand = new Random(); int randNum = rand.nextInt((max - min) + 1) + min; System.out.print(randNum); } }
import java.util.Random; public class RandomNumInRange { public static void main(String[] args) { int min = 10; int max = 20; Random rand = new Random(); int randNum = rand.nextInt((max - min) + 1) + min; System.out.print(randNum); } }