Java ThreadLocalRandom getRandomBoundedInt(int bound)

Here you can find the source of getRandomBoundedInt(int bound)

Description

bound is exclusive

License

Open Source License

Parameter

Parameter Description
bound a parameter

Declaration

public static int getRandomBoundedInt(int bound) 

Method Source Code


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

import java.util.concurrent.ThreadLocalRandom;

public class Main {
    /**//from   w w w. j  a  va2  s .  c o  m
     * bound is exclusive
     * 
     * @param bound
     * @return
     */
    public static int getRandomBoundedInt(int bound) {
        return ThreadLocalRandom.current().nextInt(bound);
    }
}

Related

  1. getLetter()
  2. getRandom()
  3. getRandom(int p)
  4. getRandom8()
  5. getRandomBetween(int min, int max)
  6. getRandomDouble(double a, double b)
  7. getRandomElement(E[] array)
  8. getRandomElement(List elements)
  9. getRandomFloat()