Random rand = new Random();我们可以将 ASCII 码 97 替换为 'a':
char c = (char)(rand.nextInt(26) + 97);
System.out.println(c);
(char)(rand.nextInt(26) + 'a');
Random rand = new Random();
字符串 str=”;
for(int i = 0 ; i < 20 ; i++){
char c = (char)(rand.nextInt(26) + 97);
str += c;
System.out.print(c+ ”);
}
f s e u k t m d a e b i m u y a y u s n
Random rand = new Random();
字符串 alphabet=abcd1235”;
int 长度 = alphabet.lentgh();
for(int i = 0; i < 30; i++) {
int k = rand.nextInt(length);
System.out.print(alphabet.charAt(k)+ ”);
}
b 1 3 1 d b b b 2 5 5 b a c 5 1 2 b 5 2 c b a 3 3 5 3 d b c 1
Please disable your ad blocker and refresh the window to use this website.