要点:可以使用Math.random()来获得一个0.0到1.0之间的随机double值,不包括1.0,这样会返回一个双精度的随机值 例如:产生一个0到9之间的随机整数 int number = (int)(Math.random()*10)