2015-09-18 86 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 
相关问题