package day12;
import java.util.Random;
public class Demo3 {
public static void main(String[] args) {
char [] arr = {'a','b','c','d','e','1','2','3','4','我','啥','去','父'};
StringBuilder sb = new StringBuilder();
Random random = new Random();
for(int i = 0; i < 4;i++){
int index = random.nextInt(arr.length);
sb.append(arr[index]);
}
System.out.println("验证码:"+sb);
}
}
重拾JAVA基础13——简单验证码实现
最新推荐文章于 2021-04-09 19:45:43 发布