Here you can find the source of randomNumber(int lower, int upper)
public static int randomNumber(int lower, int upper)
//package com.java2s; //License from project: Open Source License public class Main { public static int randomNumber(int lower, int upper) { return lower + (int) (Math.random() * ((upper - lower) + 1)); }//from w w w . ja va 2 s.c om }