public class RandomUtil
extends java.lang.Object
Random
, but they are static here.Modifier and Type | Field | Description |
---|---|---|
static java.util.Random |
random |
This is the
Random object that is used to create random numbers.You can modify this variable. |
Constructor | Description |
---|---|
RandomUtil() |
Modifier and Type | Method | Description |
---|---|---|
static boolean |
nextBoolean() |
|
static <T extends java.lang.Enum<T>> |
nextEnumValue(java.lang.Class<T> enumType) |
Gets a random enum constant from the given enum type.
|
static int |
nextInt() |
|
static int |
nextInt(int n) |
public static java.util.Random random
Random
object that is used to create random numbers.public static boolean nextBoolean()
public static int nextInt()
public static int nextInt(int n)
public static <T extends java.lang.Enum<T>> T nextEnumValue(java.lang.Class<T> enumType)
T
- the enum typeenumType
- the enum type