Java tutorial
//package com.java2s; import java.util.Random; public class Main { static Random random = new Random(); public static int randomInRange(int min, int max) { return random.nextInt(Math.abs(max - min) + 1) + min; } }