为什么这样写会出现乱码?
class testAlpha {
testAlpha(){}
static public void main(String[] args){
char tmp = 'a';
for(int i = 0; i<26;i++) {
tmp = (char)(tmp+i);
System.out.print(tmp);
}
}
}
本文介绍了一个简单的Java程序,该程序通过循环将字符'a'到'z'依次输出。文章展示了如何使用基本的Java语法实现这一功能,包括定义类、方法及使用循环结构。
为什么这样写会出现乱码?
class testAlpha {
testAlpha(){}
static public void main(String[] args){
char tmp = 'a';
for(int i = 0; i<26;i++) {
tmp = (char)(tmp+i);
System.out.print(tmp);
}
}
}
7006
1万+

被折叠的 条评论
为什么被折叠?