-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
预先感谢您为可能的解决方案。
请添加代码。 –
在“radius”和“”之间加上+是“'。字符串连接在Java中有点神秘。 – Bathsheba
谢谢,它工作! –