+4

what is difference between these syntax in java: System.out.print("*"); and System.out.println("*");

tell the difference between these syntax in java: System.out.print("*"); and System.out.println("*");

9/14/2017 4:46:14 AM

Prathamesh Dhuri

4 Answers

New Answer

+8

//in actual no difference will be there in the output of the code if u use only 1 print statement //but when u print multiple lines using these u will see the difference in the output by ur own //1) System.out.print("*"); System.out.print("*"); //output ** //2) System.out.println ("*");System.out.println("*"); //output * *

+3

System.out.print will not print a new line after it is called. System.out.println will print a new line. System.out.print("*"); System.out.print("_");// prints *_ System.out.println("*"); System.out.println("_"); // prints * // _

+1

println = Print and include a line break (enter) print = print and keep the cursor on the same line

0

System.out.print() does not break the line. System.out.println() breaks the line.