Random rand =new Random(25); int i; i=rand.nextInt(100);

初始化時25並沒有起直接作用,rand.nextInt(100);中的100是隨機數的上限,產生的隨機數為0-100的整數,不包括100。