版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/boom_man/article/details/86479921
@Test
public void randomCodeTest() {
Random random = new Random();
for (int i = 0; i < 10000; i++) {
int randomNum = random.nextInt(1000000);
String randomCode = String.format("%06d", randomNum);
System.out.println(randomCode);
}
}
相关规则参考至:https://blog.csdn.net/lonely_fireworks/article/details/7962171/