lambda with outer function
In this chapter you will learn:
Using outer variable
lambda expression can use outer variable.
using System;/*j a v a 2 s .co m*/
class Program
{
public static void Main()
{
int factor = 2;
Func<int, int> multiplier = n => n * factor;
Console.WriteLine(multiplier(3));
}
}
The output:
Next chapter...
What you will learn in the next chapter:
Home » C# Tutorial » delegate, lambda, event