In C# language and .NET framework, could you help me with understanding delegates?
I was trying to check some code, and found that the results I received were unexpected for me.
using System;
namespace ConsoleApplication1
{
class Program
{
public static int I = 0;
static Func del = new Func(() => {
return I.ToString();
});
static void Main(string[] args)
{
I = 10;
Console.WriteLine("{0}", del());
}
}
}