Here you can find the source of randomIntRange(int low, int high)
Parameter | Description |
---|---|
low | a parameter |
high | a parameter |
public static int randomIntRange(int low, int high)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from ww w. j ava2 s . c o m*/ * Get a random integer in the given half-open range. * @param low * @param high * @return int */ public static int randomIntRange(int low, int high) { return low + ((int) Math.floor(Math.random() * (high - low))); } }