Here you can find the source of randomNumber(int min, int max, Random r)
public static int randomNumber(int min, int max, Random r)
//package com.java2s; //License from project: GNU General Public License import java.util.*; public class Main { public static int randomNumber(int min, int max, Random r) { return (int) (r.nextDouble() * (max - min + 1) + min); }/* w ww . ja va 2s. co m*/ }