Here you can find the source of random(int lowerBound, int upperBound)
private static int random(int lowerBound, int upperBound)
//package com.java2s; public class Main { private static int random(int lowerBound, int upperBound) { return (lowerBound + (int) Math.round(Math.random() * (upperBound - lowerBound))); }//from w w w . j a v a2 s . com }