Java Random Int randomIntFromInterval(int min, int max)

Here you can find the source of randomIntFromInterval(int min, int max)

Description

random Int From Interval

License

Apache License

Declaration

public static int randomIntFromInterval(int min, int max) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int randomIntFromInterval(int min, int max) {
        return (int) Math.floor(Math.random() * (max - min + 1) + min);
    }/*w  ww.ja  va 2s  .c om*/
}

Related

  1. randomInt(int n)
  2. RandomInteger()
  3. randomInteger(final int upperRange)
  4. randomInteger(int low, int high)
  5. randomInteger(int min, int max)
  6. randomIntFromRange(int min, int max)
  7. randomIntInInterval(int lower, int upper)
  8. randomIntInRange(int lowerBound, int upperBound)
  9. randomIntRange(int low, int high)