2015-09-18 73 views
-2

我已經用Java編寫了一個代碼來計算一個圓的面積和圓周。當我想打印輸出,我不能做到以下幾點:如何在Java中的同一行寫兩個字符串

"The area of a circle with a radius of" +radius "is" +area 

相反,它打印,如:

"The area of a circle with a radius of" +radius 
"is" +area 

預先感謝您爲可能的解決方案。

+1

請添加代碼。 –

+2

在「radius」和「」之間加上+是「'。字符串連接在Java中有點神祕。 – Bathsheba

+0

謝謝,它工作! –

回答

0
"The area of a circle with a radius of" + radius + "is" + area 
相關問題