OP07第七章Method.pptVIP

  • 7
  • 0
  • 约1.72万字
  • 约 43页
  • 2016-09-14 发布于广东
  • 举报
5、 应用举例 随机数的产生 使用 object of class Random ( java.util); 使用 Math的静态方法 random( Math.random() ) 。 Objects of class Random can produce random boolean, byte, float, double, in , long and Gaussian values; Math method random can produce only double values in the range of [0.0, 1.0]。 Random randomNumbers = new Random(); int randomValue = randomNumbers.nextInt(); Class Random method nextInt() generates a random int value in the range of [-2147483648, + 2147483647]. The calculation uses the current time of day to seed the random number generator. How to use the class Random method nextInt() to

文档评论(0)

1亿VIP精品文档

相关文档