+ 3
Differences between Console.Write and Console.WriteLine?
8 Antworten
+ 10
As others have said, difference is WriteLine adds new line. so..
Console.Write("hi");
Console.Write("there");
will print:
hithere
but
Console.WriteLine("hi");
Console.WriteLine("there");
will print:
hi
there
+ 6
Console.Write print in line
and Console.WriteLine print in next line.
+ 5
Console.WriteLine() works as a paragraph, adding a "\n" to the end of your string line.
+ 2
"Console.Write"will leave the mouse cursor at same line.whereas
"Console.WriteLine"will move the cursor to the next line after displaying output.
eg.
Console.Write ("hello");
hello |
(mouse cursor (|) is here in same line).
Console.WriteLine("hello");
hello
|
(mouse cursor (|) is in the line below the output.)
supposing (|) is mouse cursor.
Hope now it's clear for you guys.
+ 1
As all have said as easier explain Console.Write prints on the same paragraph while Console.WriteLine prints on the next line of paragraph
0
Console.Write prints on current line and stays there.
Console.WriteLine prints on current line and ends the line.
0
single difference of next line..
- 2
Console.write prints on the same line &
Console.writeLine prints on the next line