You can generate numbers in any range by using code like this:
// Do this once
Random rnd = new java.util.Random();
// Use rnd to get random numbers in a given range (starting from zero):
int rn1 = rnd.nextInt(50); // number in range 0..49
int rn2 = rnd.nextInt(25); // number in range 0..24
// And you can modify the range like this:
int rn3 = rnd.nextInt(50) + 50; // number in range 50..99
int rn4 = rnd.nextInt(25) + 1; // number in range 1..25
int rn5 = rnd.nextInt(201) - 100; // number in range -100..100
yourRandom.nextInt(bound);
will return an integer between 0 and the bound.
For example, yourRandom.nextInt(5) will return something between 0 (inclusive) and 5 (exclusive)
if you want to have something between "x" (not being 0) and "y", y being > x then it's :
x+yourRandom.nextInt(y-x);
for example, to have something between 3 (inclusive) and 7 (exclusive):
3+yourRandom(7-3)
EDIT: sorry for the dup ^^