如何在Java中在同一行上编写两个字符串

如何在Java中在同一行上编写两个字符串,java,string,drjava,Java,String,Drjava,我已经用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 提前感谢您提供可能的解决方案 请添加代码。在半径和之间添加+是“。字符串连接在Java中有点神秘。 "The area of a circle

我已经用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

提前感谢您提供可能的解决方案

请添加代码。在
半径
之间添加+是“
。字符串连接在Java中有点神秘。
"The area of a circle with a radius of" + radius + "is" + area