public class Homework17;{

public static void main (string[] args){

String str = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";

 Random rand = new Random();

StringBuilder a = new StringBuilder(4);

for(int i=0;i<4;i++){

char c = str.charAt(rand.nextInt(str.length()));

a.append(c);

}

System .out.println(a.toString());

}

}

posted on 2020-09-27 15:28  liuyunche  阅读(313)  评论(0编辑  收藏  举报