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();
문자열 알파벳="abcd1235";
int 길이 = alphabet.lentgh();
for(int i = 0; i < 30; i++) {
int k = rand.nextInt(길이);
System.out.print(alphabet.charAt(k)+" ");
}
b 1 3 1 d b b b 2 5 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.