Java Random Int generateRandomIntInRange(int min, int max)

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

Description

generate Random Int In Range

License

Open Source License

Declaration

public static int generateRandomIntInRange(int min, int max) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int generateRandomIntInRange(int min, int max) {
        return min + (int) (Math.random() * ((max - min) + 1));
    }/* w  w w.j  a va 2  s .c o m*/
}

Related

  1. generateRandomInt(int min, int max)
  2. generateRandomInteger(int aStart, int aEnd, Random aRandom)
  3. generateRandomInteger(int start, int end)
  4. generateRandomIntegerArray(int size, int min, int max)
  5. generateRandomIntegers(int numbersNeeded, int bound)
  6. generateRandomIntObj(int range, int noOfElements)
  7. generateRandomInts(int range, int noOfElements)
  8. generateRandomIntUpto(int max)
  9. generateRandomIntValue()