Java Random Int randomIntInInterval(int lower, int upper)

Here you can find the source of randomIntInInterval(int lower, int upper)

Description

random Int In Interval

License

Open Source License

Declaration

public static int randomIntInInterval(int lower, int upper) 

Method Source Code

//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);
    }
}

Related

  1. randomInteger(final int upperRange)
  2. randomInteger(int low, int high)
  3. randomInteger(int min, int max)
  4. randomIntFromInterval(int min, int max)
  5. randomIntFromRange(int min, int max)
  6. randomIntInRange(int lowerBound, int upperBound)
  7. randomIntRange(int low, int high)
  8. randomIntWithDigits(int digits)
  9. randomKey(int sLen)