0
What is the difference btw System.out.println() and System.out.print()
3 Answers
+ 7
println adds a \n at the end of the output causing a new line in the output
print will stay on the same position, so the next print command will continue from there
+ 1
System.out.println("Hi friend");
System.out.print("Hi ");
System.out.println(",how are you ?");
System.out.print("i'm fine \nthanks!");
output : __________________
Hi friend |
Hi ,how are you ? |
i'm fine |
thanks! |
_________________________
+ 1
"Println" prints on a new line.
"Print" prints on the same line.



