This content has been marked as final. Show 6 replies
I have this, and it's working for me:
int j = rand.nextInt(500);
But I actually want it to generate a random number between 100 and 500, not 0 and 500. How could I do this?
Calculate a number between 0 and 400, then add 100.
So, like this:
or like this:
I'll take choice number two.
If you want 100 and 500 to be valid numbers then you will need this: