System.out.print("Diego ");
System.out.println("is the best!");
System.out.print("Amigo ");
System.out.println("is the best!");
output:
Diego is the best!
Amigo is the best!
First diego is printed then println command is used "is the best" it should be printed on new line ?
output i think should be
Diego
is the best!
Please explain me this concept?
i am not understanding the output?
Resolved
Comments (4)
- Popular
- New
- Old
You must be signed in to leave a comment
CodingCanuck
2 February 2019, 12:22
If you do this:
System.out.print("Diego");
System.out.println();
System.out.println("is the best");
The output will be:
Diego
is the best!
0
Kshitij Pimple
3 February 2019, 12:11
Thank you codingcanuck
0
Guadalupe Gagnon
1 February 2019, 18:56
println() created a new line after printing to screen, not before.
0
Kshitij Pimple
2 February 2019, 11:08
Thank you guadalupe gagnon.
0