java - 关于随机数生成Random的使用
伊谢尔伦
伊谢尔伦 2017-04-17 17:57:51
0
3
820

为什么会报错,求大神教!!!(PS:想生成某个范围的随机数)
是不是Random对象初始化有错? 要怎么改才对啊?

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(3)
刘奇

Your randoms are all null, and you will definitely get an error... You need to create a new Random object and assign it to random:

Random random = new Random();
// 其他代码
刘奇

Random random=new Random();

伊谢尔伦

You must have obsessive-compulsive disorder when writing code! For example, seeing warnings makes you feel uncomfortable. . . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template