Random r1=new Random();//空参数
System.out.println("int :"+r1.nextInt());
System.out.println("Long :"+r1.nextLong());
System.out.println("float :"+r1.nextFloat());//大于0小于1的小数
System.out.println("double :"+r1.nextDouble());//大于0小于的小数
System.out.println("正态 :"+r1.nextGaussian());
for(int i=0;i<5;i++)
System.out.println(r1.nextInt(10));
r1=new Random(10);//有参数 以10为种子(以相同的数字为种子每次产生的数字是一样的)
System.out.println("int :"+r1.nextInt());
System.out.println("Long :"+r1.nextLong());
System.out.println("float :"+r1.nextFloat());//大于0小于1的小数
System.out.println("double :"+r1.nextDouble());//大于0小于的小数
System.out.println("正态 :"+r1.nextGaussian());
for(int i=0;i<5;i++)
System.out.println(r1.nextInt(10));