What Is The Difference Between System.out.println And System.out.print In Java?

3

3 Answers

Anonymous Profile
Anonymous answered
System.out.println command makes the cursor to be placed in the next line of the displayed command and System.out.print command makes the cursor to be placed in the same line of the displayed command
Shumaila Sadia Profile
Shumaila Sadia answered
Output of both statements is different as when System.out.println is used, the out put is shown in next line while in case of System.out.print the output is visible on the same line. 'ln' is basically used to start a new line.
 
 
Shalvin Abraham Profile
Shalvin Abraham answered
Both commands are same in some respect, but System.out.println will insert a new line charecter "n" at the end of the input text.

Answer Question

Anonymous