I\'m trying to write code that asks for the users age and then they enter it, but I want the number to appear next to the question after you enter it.
My code looks
Use System.out.print()
instead of println
. Println
adds a new line after the arguments inside the parameter has been passed.
Use print()
instead of println()
;
System.out.println()
automatically adds a newline character. That what the ln
means.
Because you used System.out.println
which adds a new-line (\n
) after the output. Use System.out.print
instead.
System.out.print
instead of println
.
println adds a newline after it prints your output, print will just print your message.