Here you can find the source of randInt(int min, int max)
public static int randInt(int min, int max)
//package com.java2s; import java.util.Random; public class Main { public static int randInt(int min, int max) { Random rand = new Random(); int randomNum = rand.nextInt((max - min) + 1) + min; return randomNum; }//from w ww . ja v a2 s.c o m }