/** * 指定範圍的隨機數 */ public static int getRandom(int min, int max) { Random random = new Random(); return random.nextInt(max) % (max - min + 1) + min; }