java中产生0-100之间的随机整数

Math.random() 会得到一个[0,1) 的随机浮点数。

(int) (Math.random() * 100) 就会得到0-100之间的随机整数。