随机数
用 Random 类,其中内置了生成随机数的方法
Random random = new Random();
sout(random.nextInt(100)); //生成一个0-100的随机整数
sout(random.nextInt(30,40));//30-40的随机数
用 Random 类,其中内置了生成随机数的方法
Random random = new Random();
sout(random.nextInt(100)); //生成一个0-100的随机整数
sout(random.nextInt(30,40));//30-40的随机数