You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
518 B

namespace AnonymousMethod
{
internal class Program
{
private delegate void TestDelegate();
static void Main(string[] args)
{
DoTest();
}
private static void DoTest()
{
TestDelegate t = delegate() {
Console.WriteLine("Anonymous method by delegate");
};
t += () =>
{
Console.WriteLine("Anonymous method by lambda");
};
t();
}
}
}