JAVA产生指定范围的随机数

 《JAVA产生指定范围的随机数》
  产生机制: 
                     产生Min-Max之间的数字
  实现原理:
                     Math.round(Math.random()*(Max-Min)+Min) dom

 

long Temp; //不能设定为int,必须设定为long
 //产生1000到9999的随机数
 Temp=Math.round(Math.random()*8999+1000); .net


原文地址:http://blog.csdn.net/hawkxml/article/details/379302 xml

相关文章
相关标签/搜索