Java Random Int randomRange(int min, int max)

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

Description

random Range

License

LGPL

Declaration

public static int randomRange(int min, int max) 

Method Source Code

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

public class Main {
    public static int randomRange(int min, int max) {
        return min + (int) (Math.random() * ((max - min) + 1));
    }/*  w  ww. j a v  a2s  .c o  m*/
}

Related

  1. randomPointInConvexPoly(float[] pts, int npts, float[] areas, float s, float t)
  2. randomPointsFromFigureEight(int n)
  3. randomPointsFromUnitSphere(int n)
  4. randomPointsFromUnitSquare(int n)
  5. randomQuickSort(int[] array)
  6. randomSize(int maxValue)
  7. randomSMSCode(int length)
  8. randomStr(int length)
  9. randomStr(int length, String charSet)