Here you can find the source of rand(int lbound, int ubound)
public static int rand(int lbound, int ubound)
//package com.java2s; import java.util.Random; public class Main { private static Random rand = new Random(); public static int rand(int lbound, int ubound) { return (int) ((rand.nextDouble() * (ubound - lbound + 1)) + lbound); }//from w w w .ja v a2 s. c om public static double nextDouble() { return rand.nextDouble(); } }