How can you instantiate a tuple ?

 Posted by Bharathi Cherukuri on 3/17/2012 | Category: .NET Framework Interview questions | Views: 4172 | Points: 40

The following are two ways to instantiate a tuple:

1) Using the new operator

Tuple<String, int> t = new Tuple<String, int> ("Hellow", 2);

2) Using the Create factory method available in the Tuple class.

Tuple<int, int, int> t = Tuple.Create<int, int, int> (2, 4, 5);

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response