Tuesday, 23 June 2009




















using System;
delegate void mydelegate();
public class myclass
{
public void instancemethod()
{
Console.WriteLine("A message from the instance method");
}
static public void staticmethod()
{
Console.WriteLine("A message from the static method");
}
}
public class Mainclass
{
static public void Main()
{
myclass p=new myclass();
mydelegate d=new mydelegate(p.instancemethod);
d();
d=new mydelegate(myclass.staticmethod);
d();
}
}

No comments:

Post a Comment