嗯,int类型,从0到99之间作者: 土菠萝 时间: 2016-5-28 17:17
public class TestRandom {
public static void main(String[] args) {
int max = 99;
int min = 10;
Random random = new Random();
int s = random.nextInt(max)%(max-min+1) + min;
System.out.println(s);
}
} 作者: ylw787442926 时间: 2016-5-28 17:19
就是Random吗~~直接写数值就好了作者: cofujun 时间: 2016-5-28 18:24
public class Test {
public static void main(String[] args) {
Random random = new Random();
int s = random.nextInt(90) +10;
System.out.println(s);