package Demo02;
import java.util.Random;
public class Demo002 {
public static void main(String[] args) {
// 第一种随机数的获取方式
double old =Math.random();
old = old * 7 ;
System.out.println((int)(old+3));
// Random类
Random random =new Random(10);
// 获取一个【0-10)随机整数
int a = random.nextInt(10);
System.out.println(a);
for (int i = 0; i < 10; i++) {
System.out.println(random.nextInt(100));
}
}
}