Random rand = new Random();
int i=rand.nextInt(10)+1;
生成一个范围内的随机数
randNumber 将被赋值为一个 MIN 和 MAX 范围内的随机数
int randNumber =rand.nextInt(MAX - MIN + 1) + MIN;
Random rand = new Random();
int i=rand.nextInt(10)+1;
生成一个范围内的随机数
randNumber 将被赋值为一个 MIN 和 MAX 范围内的随机数
int randNumber =rand.nextInt(MAX - MIN + 1) + MIN;