Here you can find the source of getRandomInt(int min, int max)
public static int getRandomInt(int min, int max)
//package com.java2s; //License from project: Apache License import java.util.Random; public class Main { public static int getRandomInt(int min, int max) { Random rand = new Random(); int x = rand.nextInt(max - min + 1) + min; x = rand.nextInt(max - min + 1) + min; return x; }//from w ww .jav a 2 s . c o m }