“Auto increment” alphabet in Java?

后端 未结 10 2151
情书的邮戳
情书的邮戳 2020-12-02 16:53

\"Auto increment\" alphabet in Java - is this possible? From A to Z without a third-party library?

10条回答
  •  一生所求
    2020-12-02 17:38

    You are looking for something like this:

        for( int i = 'a'; i < 'z'; i++ )
            System.out.println((char)i); // Cast int to char
    

提交回复
热议问题