javaSE-验证码生成

 

 

一、使用Math类的radom() 方法

 

            //生成验证码
            String verifcationCode = "";
            for (int i = 0; i <= 5; i++) {
                double random = 10 * Math.random();
                verifcationCode = verifcationCode + Integer.toString((int) random);
            }

 

二、使用

posted @ 2021-12-15 15:59  hehehenhen  阅读(33)  评论(0)    收藏  举报