Here you can find the source of random(int min, int max)
public static int random(int min, int max)
//package com.java2s; //License from project: Open Source License public class Main { /**//from ww w .j a va2s.c o m * @return random number in the specified range, both ends inclusive */ public static int random(int min, int max) { return (int) Math.round(random((double) min, max)); } /** * @see #random(int, int) */ public static double random(double min, double max) { return min + Math.random() * (max - min); } }