Here you can find the source of randomInt(int bound)
Parameter | Description |
---|---|
bound | integer bound |
public static int randomInt(int bound)
//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); } }