Java Random Int random(int start, int end)

Here you can find the source of random(int start, int end)

Description

random

License

Open Source License

Declaration

public static int random(int start, int end) 

Method Source Code

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

public class Main {
    public static int random(int start, int end) {
        return (int) Math.round(Math.random() * (end - start - 1)) + start;
    }/*from  w  w w . j  a  v  a 2  s  .com*/
}

Related

  1. random(int min, int max)
  2. random(int n)
  3. random(int n)
  4. random(int numSamples)
  5. random(int range)
  6. random(int theRange)
  7. random(int x)
  8. random(int... array)
  9. random_range(int x1, int x2)