What is the reason why I can't put parenthesis after my Method name when assigning it to a delegate type.
Here is code:
public delegate Simple Simple(); //Create a delegate that returns its own type.
class Program
{
public class Exercise
{
public static Simple Welcome()
{
Console.WriteLine("Welcome!");
return null;
}
}
static void Main(string[] args)
{
Simple msg;
msg = Exercise.Welcome(); //Since Welcome returns Simple, I can execute it.
msg();
Console.Read();
}
}