52.Delegate without argument without return value in C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace delegate2
{
public delegate void Delegate();
class Program
{
static void hi()
{ Console.WriteLine("HI... "); }
static void welcome()
{ Console.WriteLine("Welcome to The C# Programming"); }
static void Main(string[] args)
{
Delegate obj_del = new Delegate(hi);
obj_del();
obj_del = welcome;
obj_del();
Console.Read();
}
}
}
OUTPUT:
HI...
Welcome to The C# Programming
Comments
Post a Comment