随机返回true或false

2、nextInt(int bound):

随机返回0到bound之间的整数(不包括bound)

如:nextInt(10)返回0-9之间的随机数,nextInt(100)返回0-99之间的随机数

3、nextDouble():

返回(0, 1)开区间内的小数,精度为16位

4、nextFloat():

返回(0, 1)开区间内的小数,精度为8位

 

5、应用:

 

相关文章:

  • 2021-10-11
  • 2021-11-25
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2021-08-17
  • 2022-12-23
  • 2021-07-18
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-06-28
  • 2022-02-10
  • 2022-02-10
  • 2021-11-30
相关资源
相似解决方案