验证码

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));
        }
        
    }

}

 

posted on 2015-10-13 08:28  锿咚公爵  阅读(145)  评论(0编辑  收藏  举报