1.
import java.util.Random; //导入包
Random a = new Random();
int aa = a.nextInt(100); //0~99之间的随机数
System.out.println(aa);
int bb = a.nextInt(100, 200); //100~199之间的随机数
System.out.println(bb);
2.
double b = Math.random(); //0~0.9999...的随机数
System.out.println(b);