Here you can find the source of getRandomInt(int intStart, int intEnd)
public static int getRandomInt(int intStart, int intEnd)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static int getRandomInt(int intStart, int intEnd) { return (int) ((Math.random() * intEnd) + intStart); }//from w ww .j a v a 2s . c om public static int getRandomInt(Random rand, int intStart, int intEnd) { return intStart + rand.nextInt(intEnd - intStart + 1); } }