在輸出內(nèi)容時(shí)候,怎么樣只輸出一行代碼,就可以使代碼上下分出兩行,怎么做?
風(fēng)聽舊事
2016-03-24 22:02:26
TA貢獻(xiàn)103條經(jīng)驗(yàn) 獲得超76個(gè)贊
使用System.out.print然后里面使用“\n”換行符即可。
例如:
int?a?=?3; int?b?=?4; System.out.print(a?+?"\n"?+?b);
會(huì)輸出
3 4
再如:
System.out.print("AAA\nBB");
會(huì)輸出
AAA BB
舉報(bào)