You have chosen a random generator with a constant value of 100 . It is deterministic, so it will generate the same values ββthat are executed every time.
I'm not sure why you selected it with 100 , but the initial value has nothing to do with the range of generated values ββ(which is controlled by other means, such as calling nextInt that you already have).
To get different values ββeach time, use the Random constructor without arguments, which uses the system time to generate a random generator.
Quote from Javadoc for the carefree constructor Random :
Creates a new random number generator. This constructor sets the seed of a random number generator to a value that is likely to be different from any other call to this constructor.
Quoting the actual code in a constructor without Random parameters:
public Random() { this(seedUniquifier() ^ System.nanoTime()); }
rgettman
source share