Random random = new Random();
String randomLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
for (int n=0; n<=25; n++)
System.out.print(randomLetters.charAt(random.nextInt(randomLetters.length())));
当打印随机26个字母有重复的字母,我想打印随机26个字母不打印重复的字母Java标准_Question
这一结果显示我
FXNJZMQWFTSKLRRFHOYWGTIQPWBUILD
那么你不需要随机字母你呢? (你需要''洗牌'包含26个字母的'List') –