What is a Tuple? How many values can a Tuple Hold?

  • A Tuple is a data structure which can hold data of multiple types in a single variable.
  • Tuple was first introduced in .NET 4.0.
  • A Tuple can generally represent a row in a database table, where each column can represent a different type.
  • Individual values of "Items" inside a single tuple variable can be accessed by means of properties (Item1, Item2, ..)
  • A tuple can hold a maximum of 8 Items in itself, where the individual Items can themselves be Tuples of different items.
var tuple = new Tuple<T1, T2, T3, ... , T7, T8>();
  • A Tuple is a data structure which can hold data of multiple types in a single variable.
  • Tuple was first introduced in .NET 4.0.
  • A Tuple can generally represent a row in a database table, where each column can represent a different type.
  • Individual values of "Items" inside a single tuple variable can be accessed by means of properties (Item1, Item2, ..)
  • A tuple can hold a maximum of 8 Items in itself, where the individual Items can themselves be Tuples of different items.
var tuple = new Tuple<T1, T2, T3, ... , T7, T8>();
Ram
Ram

I'm a full-stack developer and a software enthusiast who likes to play around with cloud and tech stack out of curiosity. You can connect with me on Medium, Twitter or LinkedIn.

Privacy Overview
Referbruv

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Strictly Necessary Cookies

Strictly Necessary Cookie should be enabled at all times so that we can save your preferences for cookie settings.

3rd Party Cookies

This website uses Google Analytics to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.