Java Random Long random(long begin, long end)

Here you can find the source of random(long begin, long end)

Description

random

License

Apache License

Declaration

private static long random(long begin, long end) 

Method Source Code

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

public class Main {
    private static long random(long begin, long end) {
        long rd = begin + (long) (Math.random() * (end - begin));
        if (rd == begin || rd == end) {
            return random(begin, end);
        }//from ww w .j a  va2  s . c o m
        return rd;
    }
}

Related

  1. nextLong(Random rng, long n)
  2. nextLongId()
  3. randLong()
  4. randLong(long minimum, long maximum)
  5. randLong(long n)
  6. random(long max)
  7. random(long min, long max)
  8. random(long range)
  9. randomHexOfLong(long max)