Here you can find the source of randomIntInInterval(int lower, int upper)
public static int randomIntInInterval(int lower, int upper)
//package com.java2s; public class Main { public static int randomIntInInterval(int lower, int upper) { return (int) randomFloatInInterval(lower, upper); }/*from w w w . j ava2 s.co m*/ public static float randomFloatInInterval(float lower, float upper) { return (float) (Math.random() * (Math.abs(upper - lower)) + lower); } }