public class RandomUtils extends Object
限定符和类型 | 方法和说明 |
---|---|
static boolean |
nextBoolean()
返回随机布尔值
|
static byte[] |
nextBytes(int count)
返回随机字节数组
|
static double |
nextDouble()
返回 0 到 Double.MAX_VALUE 之间的随机 double
|
static double |
nextDouble(double bound)
返回 0 到 bound - 1 范围之间的随机 float
|
static double |
nextDouble(double start,
double end)
返回 start 到 end 范围之间的随机 float
|
static float |
nextFloat()
返回 0 到 Float.MAX_VALUE 之间的随机 float
|
static float |
nextFloat(float bound)
返回 0 到 bound - 1 范围之间的随机 float
|
static float |
nextFloat(float start,
float end)
返回 start 到 end 范围之间的随机 float
|
static int |
nextInt()
返回 0 到 Integer.MAX_VALUE 之间的随机 int
|
static int |
nextInt(int bound)
返回 0 到 bound - 1 范围之间的随机 int
|
static int |
nextInt(int start,
int end)
返回 start 到 end 范围之间的随机 int
|
static long |
nextLong()
返回 0 到 Long.MAX_VALUE 之间的随机 long
|
static long |
nextLong(long bound)
返回 0 到 bound - 1 范围之间的随机 long
|
static long |
nextLong(long start,
long end)
返回 start 到 end 范围之间的随机 long
|
public static boolean nextBoolean()
public static byte[] nextBytes(int count)
count
- 返回数量public static int nextInt()
public static int nextInt(int bound)
bound
- boundpublic static int nextInt(int start, int end)
start
- 起始值end
- 结束值public static long nextLong()
public static long nextLong(long bound)
bound
- boundpublic static long nextLong(long start, long end)
start
- 起始值end
- 结束值public static float nextFloat()
public static float nextFloat(float bound)
bound
- boundpublic static float nextFloat(float start, float end)
start
- 起始值end
- 结束值public static double nextDouble()
public static double nextDouble(double bound)
bound
- boundpublic static double nextDouble(double start, double end)
start
- 起始值end
- 结束值Copyright © 2023 buession.com Inc.. All rights reserved.