If I try your code, it works for me:
import java.util.Random;
import java.util.ArrayList;
public class Main
{
public static Random rand = new Random();
public static ArrayList<Integer> randomNumbers(int number, int upperBound)
{
ArrayList<Integer> randomNumbers = new ArrayList<>();
for (int i = 0; i < number; i++) {
randomNumbers.add(rand.nextInt(upperBound) + 1);
}
return randomNumbers;
}
public static void main(String[] args) {
System.out.println(randomNumbers(10, 100));
}
}
The result as printed looks pretty random:
[78, 47, 83, 13, 68, 58, 69, 26, 15, 37]
[7, 2, 53, 42, 50, 68, 28, 7, 79, 12]
[91, 96, 6, 11, 73, 59, 49, 67, 49, 72]
So what am I doing that you aren't, or vice versa?