What is the difference between system.out.println() and system.out.print() ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the difference between system.out.println() and system.out.print() ?

7th Sep 2015, 9:38 PM
Archi
3 Answers
+ 1
println() prints the value in the bracket in a new line print() print it in the same line of the previous println() or print() statement.
21st Sep 2016, 2:06 AM
Suman Kumar
Suman Kumar - avatar
0
println() prints on a new line and print() on same line
9th Sep 2015, 5:44 AM
Chirag Jadhwani
Chirag Jadhwani - avatar
0
if you just use print, the cursor will be pointing just next to your answer whereas if you use println the cursor will be in the next immediate line after the output statement.
22nd Sep 2015, 5:16 PM
Shreyas Sharma
Shreyas Sharma - avatar