Java ThreadLocalRandom randomInt(int bound)

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

Description

Return randomize integer that is bounded by given bound

License

Open Source License

Parameter

Parameter Description
bound integer bound

Return

randomize integer

Declaration

public static int randomInt(int bound) 

Method Source Code

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

import java.util.*;
import java.util.concurrent.ThreadLocalRandom;

public class Main {
    public static final Random RANDOM = ThreadLocalRandom.current();

    /**/* w  w  w  .  jav a2 s  . co  m*/
     * Return randomize integer that is bounded by given bound
     *
     * @param bound integer bound
     * @return randomize integer
     */
    public static int randomInt(int bound) {
        return RANDOM.nextInt(bound);
    }
}

Related

  1. randomFishType()
  2. randomFixedChars(int size, List pool)
  3. randomIndexs(int count, int bound)
  4. randomInRange(int min, int max)
  5. randomInt()
  6. randomInteger(int min, int max)
  7. randomIntegerList(int min, int max, int minLength, int maxLength)
  8. randomLongs(final long count, final long min, final long max)
  9. randomLongsNonDuplicates(final long count, final long min, final long max)