//生成1位随机数字
System.out.println((int)((Math.random()*9+1)));
//生成2位随机数字
System.out.println((int)((Math.random()*9+
math的random用法(生成随机数字验证码)
最新推荐文章于 2023-02-02 18:46:27 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
//生成1位随机数字
System.out.println((int)((Math.random()*9+1)));
//生成2位随机数字
System.out.println((int)((Math.random()*9+