2
Answers

NP107 anonymous method

Ask a question
Maha

Maha

16y
2k
1

Hi Guys

 

NP106 anonymous method

 

http://www.java2s.com/Code/CSharp/Language-Basics/delegate-anonymous.htm

 

Following program is in the above website. Why does it call anonymous method?

 

Anyone knows please explain the reason.

 

Thank you

 

 

using System;

using System.Threading;

 

public delegate void DelegateClass();

 

public class Starter

{

    public static void Main()

    {

        DelegateClass del = delegate

        {

            Console.WriteLine("Running anonymous method");

        };

        del();

    }

}

/*

Running anonymous method

*/

Answers (2)