Java 生成6位纯数字验证码 发短信验证码处使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 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/

猜你喜欢

转载自blog.csdn.net/boom_man/article/details/86479921
今日推荐