Here you can find the source of getRandomIntFromRange(int min, int max)
public static int getRandomIntFromRange(int min, int max)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { public static final Random random = new Random(); public static int getRandomIntFromRange(int min, int max) { return min + (max > min ? random.nextInt(1 + max - min) : 0); }/* ww w . ja v a 2s . c om*/ }