//验证码
package com;
import java.util.Random;
public class World {
public static void main(String[] args) {
System.out.println(ma(5));
}
public static String ma(int n){
Random random=new Random();
String p="";
for (int i = 0; i < n; i++) {
int t = random.nextInt(3);//随机生成0-2
switch (t){
case 0:
char ch=(char)random.nextInt(65,90);//大写字母
p+=ch;
break;
case 1:
char c=(char)random.nextInt(97,122);//小写字母
p+=c;
break;
case 2:
p+=random.nextInt(10);//数字
break;
}
}
return p;
}
}