int[] rands = new int[amount] Random rand = new Random(); for (int i = 0; i < amount; ++i) { rands[i] = rand.nextInt(45); }