Java examples for java.util:Random Int
get Range Random
//package com.java2s; public class Main { public static int getRangeRandom(int min, int max) { return (int) (Math.random() * (max - min + 1) + min); }//from ww w. j a v a 2 s . c om public static int getRangeRandom(int max) { return (int) (Math.random() * (double) max); } }