public class Randoms extends Object
| Modifier and Type | Field and Description |
|---|---|
static char[] |
ALPHA |
protected static int |
charMaxIndex |
protected static int |
charMinIndex |
protected static int |
lowerMaxIndex |
protected static int |
lowerMinIndex |
protected static int |
numMaxIndex |
protected static Random |
RANDOM |
protected static int |
upperMaxIndex |
protected static int |
upperMinIndex |
| Constructor and Description |
|---|
Randoms() |
| Modifier and Type | Method and Description |
|---|---|
static char |
alpha()
返回ALPHA中的随机字符
|
static char |
alpha(int num)
返回ALPHA中第0位到第num位的随机字符
|
static char |
alpha(int min,
int max)
返回ALPHA中第min位到第max位的随机字符
|
static int |
num(int num)
产生0-num的随机数,不包括num
|
static int |
num(int min,
int max)
产生两个数之间的随机数
|
protected static final Random RANDOM
public static final char[] ALPHA
protected static final int numMaxIndex
protected static final int charMinIndex
protected static final int charMaxIndex
protected static final int upperMinIndex
protected static final int upperMaxIndex
protected static final int lowerMinIndex
protected static final int lowerMaxIndex
public static int num(int min,
int max)
min - 最小值max - 最大值public static int num(int num)
num - 最大值public static char alpha()
public static char alpha(int num)
num - 到第几位结束public static char alpha(int min,
int max)
min - 从第几位开始max - 到第几位结束Copyright © 2020. All rights reserved.