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') –