1
Answer

why we use delegate Func<T>

Photo of Hemant Mehra

Hemant Mehra

10y
1.2k
1
why we use delegate Func<T> there...
using System;

class Test
{
   static void Main()
   {
      Func<string> func = GetGreeting; // no parameters but returns a string
      Console.WriteLine(func());
      Console.ReadKey();
   }

   static string GetGreeting()
   {
      return "Hello Jitendra :)";
   }
}

Answers (1)