package demo; import java.util.Random; /** * <p>随机工具类</p> * * @author: wuhongjun * @version:1.0 */ public class Randoms { private static final Random RANDOM = new Random(); //定义验证码字符.去除了O和I等容易混淆的字母 public static final char ALPHA[]={'A','B','C','D','E','F','G','H','G','K','M','N','P','Q','R','S','T','U','V','W','X','Y','Z' ,'a','b','c','d','e','f','g','h','i','j','k','m','n','p','q','r','s','t','u','v','w','x','y','z','2','3','4','5','6','7','8','9'}; /** * 产生两个数之间的随机数 * @param min 小数 * @param max 比min大的数 * @return int 随机数字 */ public static int num(int min, int max) { return min + RANDOM.nextInt(max - min); } /** * 产生0--num的随机数,不包括num * @param num 数字 * @return int 随机数字 */ public static int num(int num) { return RANDOM.nextInt(num); } public static char alpha() { return ALPHA[num(0, ALPHA.length)]; } }

代码男神2019 LV10
2021年11月21日
17665202833 LV2
2021年7月1日
天险无涯 LV15
2021年2月2日
846173996 LV2
2021年1月26日
数据库1 LV12
2020年7月11日
gan857569302 LV9
2020年6月28日
104227972 LV1
2020年4月24日
rainsheep LV5
2020年4月1日
Alex_zpy LV13
2020年3月4日
zengtianzhi LV2
2019年12月14日

3334004690 LV10
2024年6月8日
EFWAGGFAWGR
2023年10月19日
暂无贡献等级
zxh2023 LV1
2023年6月30日
12522425 LV13
2023年4月15日
dxn111
2022年11月28日
暂无贡献等级
张好好 LV1
2022年10月26日
tianli3000 LV8
2022年4月28日
JohnAlex LV9
2022年1月29日
17798830 LV14
2022年1月25日
代码男神2019 LV10
2021年11月21日