今天我偶尔做了个测试,测试回车,代码如下:
public class TestChar {
public static void main(String[] args) {
char c = '\r';
System.out.println("aaa" + c + "bbb");
}
}
输出结果:bbb
为什么不是:aaa
bbb
啊?
望高手详细解答!
public class TestChar {
public static void main(String[] args) {
char c = '\r';
System.out.println("aaa" + c + "bbb");
}
}
输出结果:bbb
为什么不是:aaa
bbb
啊?
望高手详细解答!
bbb
char c = '\n',能得到换行的目的,为什么能?
难道eclispe对'\r','\n'有什么特别的吗?