static
void
main(String[] args) {
long
t = System.currentTimeMillis();
//获得当前时间的毫秒数
Random rd =
new
Random(t);
//作为种子数传入到Random的构造器中
System.out.println(rd.nextInt());
//生成随即整数
}
}
|
最后
以上就是怕孤独苗条最近收集整理的关于获得以当前时间为种子的随机数的全部内容,更多相关获得以当前时间为种子内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复