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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…