What method returns a random int between a min and max? Or does no such method exist?
What I\'m looking for is something like this:
NAMEOFMETHOD (mi
This generates a random integer of size psize
public static Integer getRandom(Integer pSize) {
if(pSize<=0) {
return null;
}
Double min_d = Math.pow(10, pSize.doubleValue()-1D);
Double max_d = (Math.pow(10, (pSize).doubleValue()))-1D;
int min = min_d.intValue();
int max = max_d.intValue();
return RAND.nextInt(max-min) + min;
}