编写一个Java应用程序,输出全部的大写英文字母?
public class Demo03 { public static void main(String[] args) { for(int i=0;i<26;i++){ System.out.print((char)('A' + i) + " "); } }}
java中怎么输出字母表中所有的大写字母?
如下代码可打印大写字母表
public class English {
public void printEnglish()
{
int firstEnglish, lastEnglish;
char firstE = 'A', lastE = 'Z'; //获取首字母与末字母的值
firstEnglish = (int)firstE;
lastEnglish = (int)lastE;
System.out.println("英文大写字母表: ");
for(int i = firstEnglish; i <= lastEnglish; ++i)
{
char uppercase, lowercase;
uppercase = (char)i;
lowercase = (char)(i + 32);
System.out.print(" " + uppercase + lowercase);
}
System.out.println();
}
}

