天天看點

換行符和制表符

\n: 換行符。結束光标目前所在行,光标進入下一行。

\t: 制表符。代表四個字元。

比如:

System.out.print("ABC\n") = System.out.println("ABC")

列印出來時就是兩行,第二行是空行:

1. ABC

2.

System.out.print("ABC\t") = System.out.print("ABC    ")

列印出來就是一行,但ABC後來還有四個空白字元:

1. ABC****