How can you instantiate a tuple ?

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

The following are two ways to instantiate a tuple:

1) Using the new operator
Example:

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


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

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