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