Here you can find the source of randInt(int min, int max)
public static int randInt(int min, int max)
//package com.java2s; //License from project: Open Source License import java.util.Random; public class Main { private static Random random = new Random(); public static int randInt(int max) { // Returns a random number below max. return random.nextInt(max); }/*from w ww . ja va 2 s .c o m*/ public static int randInt(int min, int max) { // Returns a random number // between min and max. return min + random.nextInt((max + 1) - min); } }