- C# 7 and .NET Core Cookbook
- Dirk Strauss
- 118字
- 2021-07-03 00:11:50
Working with Tuples - getting started
I have come across many instances where I wanted to return more than one value from a method. As Mads Torgersen pointed out, the existing options available to developers are not optimal. C# 7.0 has, therefore, introduced Tuple types and Tuple literals to allow developers an easy way of returning multiple values from methods. Developers can also rest easy when creating Tuples. Tuples are structs, which are value types. This means that they are created locally and are passed by copying the contents. Tuples are also mutable and Tuple elements are public mutable fields. I am personally very excited about using Tuples. Let's explore Tuples in closer detail in the following recipe.
推薦閱讀
- Vue.js 3.x快速入門
- PHP 從入門到項(xiàng)目實(shí)踐(超值版)
- Rust編程從入門到實(shí)戰(zhàn)
- Python時(shí)間序列預(yù)測(cè)
- Julia 1.0 Programming Complete Reference Guide
- Building Serverless Web Applications
- Python函數(shù)式編程(第2版)
- 交互式程序設(shè)計(jì)(第2版)
- IPython Interactive Computing and Visualization Cookbook
- 3ds Max 2018從入門到精通
- Python無(wú)監(jiān)督學(xué)習(xí)
- Three.js Essentials
- Learning PrimeFaces Extensions Development
- Splunk Developer's Guide(Second Edition)
- Real-time Analytics with Storm and Cassandra