Java Random Long random(long max)

Here you can find the source of random(long max)

Description

random

License

Apache License

Declaration

public static long random(long max) 

Method Source Code

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

public class Main {

    public static long random(long max) {
        return (long) (Math.random() * max);
    }/*from   ww  w.  j a v a 2s  .  co  m*/

    public static int random(int max) {
        return (int) (Math.random() * max);
    }
}

Related

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