0

I think system.out.print is enough to display the output , but why we are using println , can anyone??

24th Nov 2016, 6:35 AM
palla sudheer Kumar
6 Réponses
+ 3
println adds a line break at then end of the output, for example: System.out.print("hello"); System.out.print("world!"); //Prints: //helloworld! System.out.println("hello"); System.out.println("world!"); //Prints: //hello //world!
24th Nov 2016, 6:42 AM
Wagner Silvestre Wuchryn Martins
Wagner Silvestre Wuchryn Martins - avatar
+ 2
And System.out.println("Hello"); System.out.print("World!!"); Will print Hello World!!
28th Nov 2016, 12:41 AM
Angel Perez
Angel Perez - avatar
+ 1
1. print("Hello\nJava"); 2. println("Hello"); print("Java"); Both the above cases give the result as Hello Java
14th Feb 2017, 11:18 AM
Kommoju Sunil Kumar
Kommoju Sunil Kumar - avatar
0
What Wagner said
24th Nov 2016, 8:46 AM
Mannan Rehbari
Mannan Rehbari - avatar
0
Make code simple
1st Dec 2016, 8:44 AM
littleStone
littleStone - avatar
0
print statement will print all the strings in single line println statement print in next line.. we use both statements according to the requirement.
1st Dec 2016, 9:58 AM
Lu$er
Lu$er - avatar