I need to write a program where the output will be on the same line as the input. I have tried print() and println() but they come out the same. What do I need to add?
String str= scanner.next();
System.out.println(" donut");
the output is (if I were to type in apple)
apple
donut
but I want it to print
apple donut