【文件属性】:
文件名称:C# 7.0 新特性1之基于Tuple的“多”返回值方法
文件大小:69KB
文件格式:PDF
更新时间:2021-01-20 05:48:55
c# le 方法
原文链接:http://www.cnblogs.com/ylvict/p/5573094.html
回顾
首先,提出一个问题,C#中,如何使一个方法可返回”多个”返回值?
我们先来回顾一下C#6.0 及更早版本的做法。
在C#中,通常我们有以下4种方式使一个方法返回多条数据。
•使用 KeyValue 组合
•
static void Main(string[] args)
{
int int1 = 15;
int int2 = 25;
var result = Add_Multiply(int1, int2);
Console.WriteLine(result.Key)