static void Main(string[] args) { //var t = Tuple.Create<string, int>("Vishal", 29); //var t = Tuple.Create("Vishal", 29, new Tuple<string, string>("Rajkot","Gujarat"));
//It will give compilation error, as Tuple.Create method can only create upto 8 elements. //var t = Tuple.Create(1,2,3,4,5,6,7,8,9);
//It will work because new Tuple<> can create 8 or more elements. //var t = Tuple.Create(1, 2, 3, 4, 5, 6, 7, new Tuple<int, int>(8, 9)); //Console.WriteLine(t);
//It can access with Item1, Item2, t.Rest.Item1.Item2, etc. var t = Tuple.Create(1, 2, 3, 4, 5, 6, 7, new Tuple<int, int>(8, 9)); Console.WriteLine(t.Rest.Item1.Item2);
//Console.WriteLine(t); Console.Read(); }
|