The following method delivers a number between 10000 and 99999:
public int generateRandom5DigitNumber() {
// get a random number between 0.0 and 0.99~999
double random = Math.random();
// initialize the return value as the smallest 5-digit number
int returnValue = 10000;
// now we have to combine the initial return value with our random number
// first we have to convert our random to a value between 0 and 89999...
int randomPartToAdd = (int)((random * 90000));
// ...and add it then to the initial value
return returnValue + randomPartToAdd;
}