Search code examples
javastringdrjava

How to write 2 strings on same line in Java


I have written a code in Java to compute the area and circumference of a circle. When I want to print the output, I can not do the following:

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

Instead, it prints like:

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

Thank you in advance for possible solutions.


Solution

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