Simple examples of random numbers in Java production 1-100 (shared)

Just call random in math directly, which is simple and convenient

int i = (int)(Math.random()*100+1);

The above simple example (sharing) of random numbers in Java production 1-100 is all the content shared by Xiaobian. I hope it can give you a reference and support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>