Here you can find the source of randomNumberWithinRange(int min, int max)
Parameter | Description |
---|---|
min | The minimum value |
max | The maximum value |
static Integer randomNumberWithinRange(int min, int max)
//package com.java2s; //License from project: Open Source License public class Main { /**// w ww .jav a 2s. co m * Returns a random number within the given range. * * @param min The minimum value * @param max The maximum value * @return The random number */ static Integer randomNumberWithinRange(int min, int max) { return ((int) (Math.random() * max)) + min; } }