如下代码可打印大写字母表
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();
}
}