Reference object in Console.WriteLine in CSharp
Description
The following code shows how to reference object in Console.WriteLine.
Example
/*from w w w .j a va 2s .c om*/
using System;
using System.Collections.Generic;
using System.Text;
class Program {
static void Main(string[] args) {
object[] stuff = { "Hello", 20.9, 1, "There", "83", 99.99933 };
Console.WriteLine("The Stuff: {0} , {1} , {2} , {3} , {4} , {5} ", stuff);
Console.WriteLine("{0}, Number{0}, Number{0}", 9);
}
}
The code above generates the following result.