13.4 获得验证码

获得验证码:





char [] ch={'阿','德','美','爱','中','理','a','耶'};


StringBuilder  sb= new StringBuilder();
Random random = new Random();
int index;
for(int i=0;i<4;i++)


index = random.nextInt(ch.length) ;
sb.append(ch[index]);

}
System.out.println("sb容器:"+sb);

你可能感兴趣的:(Java)