求帮忙,不想使用初始化一个【A-Z】数组,有没有其他很好的方法?

解决方案 »

  1.   

    不想使用初始化是什么意思?想了下,有很多方法啊,枚举,map或者直接用ase2码应该都行
      

  2.   

    public class Test02 { public static void main(String[] args) { for (int i = 0; i < 26; i++) {
    char c = 'a';
    c = (char) (c + i);// (int)(Math.random()*26)
    System.out.println(c);
    }

    char c = 'a';
    c = (char) (c + (int)(Math.random()*26));//随机产生0-26的数 
    System.out.println(c);
    }}
      

  3.   

    初始化数组就是把[a-zA-Z]放在数组里,在取随机值,能不能用[a-zA-Z][65+26]或者[97+26]开始的方式来取随机的一个
      

  4.   

    这个不行么?用ase2码,不用把字母放到数组里