当前位置: 代码迷 >> J2SE >> random for a series of random numbers?
  详细解决方案

random for a series of random numbers?

热度:510   发布时间:2016-04-24 17:44:42.0
random for a series of random numbers??????
Using   Math.random   works   well   when   you   need   to   generate   a   single   random   number.   If   you   need   to   generate   a   series   of   random   numbers,   you   should   create   an   instance   of   java.util.Random   and   invoke   methods   on   that   object   to   generate   numbers.   

我想让大家帮忙给俺个这样的例子,用java.util.Random中的哪些方法就可以产生一系列的随机数呢???

------解决方案--------------------
nextBytes(byte[] bytes)
------解决方案--------------------
Random r = new Random ();
r.nextDouble(),r.nextFloat(),r.nextInt()...
------解决方案--------------------
blog 更新:
think in java 各章后练习答案.....
http://blog.csdn.net/heimaoxiaozi/
  相关解决方案