C#参数使用场景简要说明
1、传值参数
2、输出参数
3、引用参数
4、具名参数
5、方法扩展(this参数)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Linq;
namespace PamametersExample9
{
class Program
{
static void Main(string[] args)
{
List<int> vs = new List<int>() { 11, 21, 13, 1, 15 };
bool b = AllCreateThanTen(vs);
bool b1 = vs.All(i => i > 10);
Console.WriteLine(b);
Console.WriteLine(b1);
}
static bool AllCreateThanTen( List<int> vs)
{
foreach (var item in vs)
{
if (item <= 10)
{
return false;
}
}
return true;
}
}
}
6、可选参数
7、数组参数