How to keep my user input on the same line after an output?

后端 未结 4 1100
孤街浪徒
孤街浪徒 2020-12-04 01:30

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

4条回答
  •  隐瞒了意图╮
    2020-12-04 02:23

    Because you used System.out.println which adds a new-line (\n) after the output. Use System.out.print instead.

提交回复
热议问题