java 随机数的生成 private static Random random = new Random(); int num = random.nextInt(10); (int)(1+Math.random()*10)