+ 4

System.out.println, print

What is difference between System.out.println() and System.out.print()

23rd Dec 2017, 3:04 PM
VIGNESHWARAN SUBRAMANIAM
VIGNESHWARAN SUBRAMANIAM - avatar
4 Answers
+ 13
System.out.println ("something") ; = System.out.print ("something\n"); = System.out.print ("something"+"\n");
23rd Dec 2017, 10:27 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 5
println adds a "new line"
23rd Dec 2017, 3:08 PM
ifl
ifl - avatar
+ 5
.println adds a new line after printing the code while .print doesn't.
23rd Dec 2017, 3:46 PM
Karan Kumar
Karan Kumar - avatar
+ 3
thanks ifl
23rd Dec 2017, 3:13 PM
VIGNESHWARAN SUBRAMANIAM
VIGNESHWARAN SUBRAMANIAM - avatar