I use this method:
def getRandomNumber(int num){
Random random = new Random()
return random.getRandomDigits(num)
}
when I call it I
There is no such method as java.util.Random.getRandomDigits.
To get a random number use nextInt:
return random.nextInt(10 ** num)
Also you should create the random object once when your application starts:
Random random = new Random()
You should not create a new random object every time you want a new random number. Doing this destroys the randomness.