Q: Java: how do I print 2 System.out.println's on the same console line I would like to print two things (println) on the same console line. How would I do this?
example code:
System.out.println("test");
System.out.println("test1");

and in the console I would like to see:

test test1


A: Change the first one to System.out.print() and add a space like,
System.out.print("test ");
System.out.println("test1");

Alternatively, you could potentially use formatted output like
System.out.printf("%s %s%n", "test", "test1");


A: Use System.out.print instead of System.out.println

A: You can use System.out.print("your text") to print without a linebreak

A: println prints a new line after the input.
