C#C
C#3y ago
júlio

❔ Delegates

c#
namespace MWE
{
    internal class Program
    {
        static int add(int a, int b) { 
            return a + b;
        }
        static void Main(string[] args)
        {
            Delegate esum = add;
            Console.WriteLine(esum(4, 6));
        }
    }
}

This code doesn't compile and I don't understand the issue.
What Am I doing wrong?
image.png
Was this page helpful?