/*
* Takes Max and Min value and returns a random no
*/
public static int getRandomValue(int min, int max) {
Random foo = new Random();
int randomNumber = foo.nextInt(max - min) + min;
if (randomNumber == min) {
return min + 1;
} else {
return randomNumber;
}
}
* Takes Max and Min value and returns a random no
*/
public static int getRandomValue(int min, int max) {
Random foo = new Random();
int randomNumber = foo.nextInt(max - min) + min;
if (randomNumber == min) {
return min + 1;
} else {
return randomNumber;
}
}
No comments:
Post a Comment