添加Lesson14
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
namespace Lesson14_匿名函数练习
|
||||
{
|
||||
class Program
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
Func<int, int> func = Dosomething(3);
|
||||
int result = func(2);
|
||||
Console.WriteLine(result);
|
||||
}
|
||||
public static Func<int, int> Dosomething(int value)
|
||||
{
|
||||
return delegate (int x)
|
||||
{
|
||||
return value * x;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user