Quote:
Originally Posted by patrickh
That's because you are setting the seed to the current millis every time you call the function. So if you call the same function within the same ms, you get the same numbers.
The proper way is create the random generator only once and keep calling nextInt() only.
|
i almost second that... only that your first random will always show the same number regardless of what amount of ms used... however, calling the nextInt will initiate a proper random number