Here you can find the source of generateRandomNumber(int min, int max)
public static int generateRandomNumber(int min, int max)
//package com.java2s; //License from project: Open Source License public class Main { public static int generateRandomNumber(int min, int max) { return (int) (min + (Math.random() * ((max - min) + 1))); }//w w w . jav a 2s . c o m }