+ 1
Hi.What's the difference between System.out.print() and System.out.println() ?
6 Answers
+ 11
1) System.out.print ("a");
System.out.print("b");
//output ::: ab
2) System.out.println("a");
System.out.println("b");
//output ::: a
b
3)System.out.print("a");
System.out.println("b");
//output ::: a
b
4)System.out.println("a");
System.out.print("b");
//output ::: a
b
5)System.out.print("a" + "\n" + "b");
//output ::: a
b
//hope it helps âș
+ 10
The println() method, after being called, prints the required text as the output and moves the cursor to a new line.
The print() method instead prints just the text but does not move the cursor to a new line.
+ 9
The println("...") method prints the string "..." and moves the cursor to a new line. The print("...") method instead prints just the string "...", but does not move the cursor to a new line.
+ 6
println ______\n
print________
+ 1
Thank you all