+ 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