会员
周边
捐助
新闻
博问
闪存
赞助商
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
lgp20151222
首页
管理
2018年3月19日
Java获取随机数的3种方法
摘要: 最小值 最大值(整数)的随机数 方法1 (数据类型)(最小值+Math.random()*(最大值-最小值+1)) 例: (int)(1+Math.random()*(10-1+1)) //从1到10的int型随数 方法2 (类型)最小值+Math.random()*最大值 for (int i=0
阅读全文
posted @ 2018-03-19 11:29 lgp20151222
阅读(1026)
评论(0)
推荐(0)
编辑