生成随机数的三种方法
1.Math类的静态方法random()
double Math.random() [0-1)之间的double型数
2.
Random r=new Random();
r.nextDouble(); //在[0-1)之间的double型数
r.nextFloat(); //在[0-1)之间的float型数
r.nextInt(); //在int型中的数
r.nextLong(); //在long类型中的数
r.nextBoolean(); // 在boolean型中的值
r.nextInt(100); //[0-100)之间的Int型数
3. System类的静态方法currentTimeMillis()
System.currentTimeMillis(); //生成long型的毫秒时间戳