[讨论]小心这道程序!
public class Test{public static void main(String args[]){
int[]a=new int[6];
int i;
for( i=0;i<6;i++){
a[i]=i;
}
for( i=0;i<6;i++){
System.out.println(a[i]+'\n');
}
}
}
大家觉得输出是多少?
为什么单引号的'\n'就变成了10,11,12,13,14,15,双引号就是012345,单引号的\n是什么意思,请楼主指教
'\n' is a char
"\n" is a String
int + char is a int
int +String is a String
that's right?