Java Random Int random(int min, int max)

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

Description

random

License

Open Source License

Declaration

public static int random(int min, int max) 

Method Source Code

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

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

    public static double random(double min, double max) {
        return (min + (Math.random() * max));
    }

    public static long random(long min, long max) {
        return (min + ((long) Math.random() * max));
    }
}

Related

  1. Random(int low, int high)
  2. random(int lowerBound, int upperBound)
  3. random(int maxValue)
  4. random(int min, int max)
  5. random(int min, int max)
  6. random(int min, int max)
  7. random(int min, int max)
  8. random(int min, int max)
  9. random(int n)