Define an anonymous method with the delegate keyword. : delegate anonymous : Language Basics C# Source Code


Custom Search

C# Source Code » Language Basics » delegate anonymous »

 

Define an anonymous method with the delegate keyword.








    
 

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();
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Language Basics
» delegate anonymous