Java tutorial
//package com.java2s; import java.util.Random; public class Main { static int randomNumber(int first, int second) { Random r = new Random(); int bigger = Math.max(first, second); int smaller = Math.min(first, second); return r.nextInt(bigger - smaller + 1) + smaller; } }