I don't think you can stop the JVM from randomly generating the next value different from the previous ones........because JVM doesn't store which values it has already generated in a range.......
Though you can control it, & put the random values in a Set..this way you can ensure that values are not duplicated........
You could create a List of all the numbers in the range, then call Collections.shuffle() on it. Now you have a list of numbers in random order with no repetitions.
"I'm not back." - Bill Harding, Twister
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this: