Tuple is a data structure which gives you the easiest way to represent a data set which has multiple values that may/may not be related to each other.
Item6 Property is used to get the sixth element of the given tuple. It is not applicable on 1-Tuple, 2-Tuple, 3-Tuple, 4-Tuple, and 5-Tuple but applicable on all other remaining tuples.
Syntax:
public T6 Item6 { get; }
Here,
T6 is the value of the current Tuple<> object's sixth component. This Tuple<> can be 6-tuple, or 7-tuple, or 8-tuple.
Example: In the below code, you can see that we are accessing the sixth element of each tuple.
Output:
Student-6 Contact No.: 230134832
Student-7 Contact No.: 384749829
Student-8 Contact No.: 235678909
Note: You can also get the type of the Sixth component of the tuple by using
GetType() method or by using
Type.GetGenericArguments method.
Example: