21
1
using System;
2
3
namespace HelloFunctional
4
{
5
public class Program
6
{
7
public static void Main(string[] args)
8
{
9
Func<int, int> f = (x) => x + 2;
10
int i = f(1);
11
Console.WriteLine(i);
12
13
f = (x) => 2 * x + 1;
14
i = f(1);
15
Console.WriteLine(i);
16
17
Console.WriteLine("Press [Enter] to exist.");
18
Console.ReadLine();
19
}
20
}
21
}
Cached Result