+ 1
explain this code and result
static void Main(string[] args) { int x = 10; double y = 20; Console.WriteLine("x = {0}; y = {1}", x, y); } // Output: x = 10; y = 20
2 odpowiedzi
+ 1
{} and {} seem to be placeholders for the variables that are inserted, and 0 and 1 the indexes of the variables in the order they follow.
+ 1
HonFu That is true. {} Are placeholders. That is the way c# can print the values of its variables.