验证码
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)); } } }