What is the difference between Console.Write ('H') and Console.Write ('H') in C #

What is the difference between Console.Write ('H') and Console.Write ('H') in C #?

+4
source share
3 answers

One uses string overloading (the string "H" ), which uses char overloading (char 'H' char 'H' ). Both output the H character to the stream defined in Console.Out without adding a new line.

+11
source

'H' is one character ( char ), while "H" can have more than one character ( string ).

+2
source

The difference is that in the first call you pass the string , and in the second call you pass the char . Practically speaking, these two calls are equivalent.

+2
source

All Articles