Here you can find the source of random(int min, int max)
private static int random(int min, int max)
//package com.java2s; //License from project: Apache License public class Main { private static int random(int min, int max) { return (int) (min + Math.random() * (max - min)); }//from w w w. j ava2 s . c o m }