C# Tuple<T1> Class Last Updated : 31 Jan, 2025 Comments Improve Suggest changes Like Article Like Report Tuple<T1> class is used to create a 1-tuple or singleton which contains only a single element in it. We can instantiate a Tuple <T1> object by calling either the Tuple<T1> constructor or by the static Tuple.Create method. We can retrieve the value of the tuple’s single element by using the read-only Item1 instance property. There are some important points which are mentioned below:It implements the IStructuralComparable, IStructuralEquatable, and IComparable interface.It is defined under the System.namespace.It represents multiple data into a single data set.It allows us to create, manipulate, and access data sets.It returns multiple values from a method without using the out parameter.It allows multiple values to be passed to a method with the help of single parameters.It can also store duplicate elements.Constructor// Initializes a new instance of the Tuple<T1> class.Tuple<T1>(T1)PropertyItem1: Gets the value of the Tuple<T1> object’s single element.Example: C# // C# program to illustrate the constructor // and property of class Tuple<T1> using System; class Geeks { static public void Main() { // Creating 1-Tuple // Using Tuple<T1>(T1) Tuple<int> t = new Tuple<int>(357); // Accessing the values Console.WriteLine("Value of Element: " + t.Item1); } } OutputValue of Element: 357 Tuple Methods Method DescriptionEquals(Object)Returns a value that indicates whether the current Tuple<T1> object is equal to a specified object.GetHashCode()Returns the hash code for the current Tuple<T1> object.GetType()Gets the Type of the current instance.MemberwiseClone()Creates a shallow copy of the current Object.ToString()Returns a string that represents the value of this Tuple<T1> instance.Example: C# // C# program to determine the // given tuples are equal or not using System; class Geeks { static public void Main() { // Creating 1-Tuple // Using Tuple<T1>(T1) Tuple<int> t1 = new Tuple<int>(22); Tuple<int> t2 = new Tuple<int>(22); // Using Equals method if (t1.Equals(t2)) Console.WriteLine("Tuple Matched."); else Console.WriteLine("Tuple not matched."); } } OutputTuple Matched. Comment More infoAdvertise with us Next Article C# Tuple<T1> Class ankita_saini Follow Improve Article Tags : C# CSharp-Tuple Similar Reads C# Tuple<T1,T2> Class The Tuple<T1, T2> is used to create a 2-tuple or pair. It represents a tuple which contains the two elements in it. We can instantiate a Tuple<T1, T2> object by calling either the Tuple<T1, T2>(T1, T2) constructor or the static Tuple.Create method. We can retrieve the value of the 2 min read C# Tuple<T1,T2,T3> Class Tuple<T1, T2, T3> class creates a 3-tuple or triple. It represents a tuple that contains three elements. we can instantiate a Tuple<T1, T2, T3> object by calling either the Tuple<T1, T2, T3>(T1, T2, T3) constructor or by the static Tuple.Create method. We can retrieve the value of 2 min read C# Tuple<T1,T2,T3,T4> Class Tuple<T1, T2, T3, T4> class creates a 4-tuple or quadruple. It represents a tuple that contains four elements. we can instantiate a Tuple<T1, T2, T3, T4> object by calling either the Tuple<T1, T2, T3, T4>(T1, T2, T3, T4) constructor or by the static Tuple.Create method.It implement 2 min read C# Tuple<T1,T2,T3,T4,T5> Class Tuple<T1, T2, T3, T4, T5> class creates a 5 Tuple or quintuple. It represents a tuple that contains five elements. We can instantiate a Tuple<T1, T2, T3, T4, T5> object by calling either the Tuple<T1, T2, T3, T4, T5>(T1, T2, T3, T4, T5) constructor or by the static Tuple.Create met 3 min read C# Tuple<T1,T2,T3,T4,T5,T6> Class Tuple<T1, T2, T3, T4, T5, T6> class creates a 6-tuple or sextuple. It represents a tuple that contains six elements. You can instantiate a Tuple<T1, T2, T3, T4, T5, T6> object by calling either the Tuple<T1, T2, T3, T4, T5, T6>(T1, T2, T3, T4, T5, T6) constructor or by the static T 3 min read Like