1 String a = new String("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); 2 3 System.out.print("请输入验证码:"); 4 5 for (int b=0; b<=5; b++) 6 { 7 Random rn = new Random(); 8 9 int c = rn.nextInt(62); 10 11 System.out.print(a.charAt(c) + " "); 12 }