生成6位数字验证码
作者:互联网
@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); } }
标签:Random,数字,int,random,验证码,randomNum,生成,randomCode,String 来源: https://www.cnblogs.com/Ao0216/p/15863756.html