首页 > 技术文章 > 验证码

shadowduke 2015-10-13 08:28 原文

package 数字操作类;

import java.util.Random;

public class yanzhengma {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        String str = new String("0123456789abcdefghijklmnopqrstuvwxyzABCEEFGHIJKLMNOPQRSTUVWXYZ");
        
        int a;
        
        Random sj = new Random();
        
        System.out.print("验证码是:");
        
        for(int j = 0;j <= 4; j++)
        {
            a = sj.nextInt(62);
            
            System.out.print("" + str.charAt(a));
        }
        
    }

}

 

推荐阅读