0
C# topic for methods contains mistake
As you can see in the example, void Print(int a) { Console.WriteLine("Value: "+a); } The + operator is used to concatenate values. In this case, the value of a is joined to the text "Value: ". You will get an error because "a" is integer, not string!
1 Antwort
0
(1) Here '+' is overloaded to string concatenation (automatically).
(2) Each character printed on Console is typecasted to string, So "a" is int type but when it's value is getting printed on Console screen the value of "a" is treated as "String" not as "Integer".