the using the System; the using the System.Collections.Generic; the using the System.Linq; the using the System.Text; the using System.Threading.Tasks; namespace Day11 { class Program {
// No Return Value delegate public the delegate void delegateShow ( int N1, int N2) ; // return a value delegate public the delegate int GuangChaoshi ( int A, int B); // generic class with public the delegate void delegateAdd (); public Event delegateAdd eventAdd; static void the Main ( String [] args) { // built trust #region built delegate Func < int , int , int > = func2 (N1, N2) => { return N1 / N2; }; Console. the WriteLine ( " built-commissioned output: " + func2 ( . 9 , . 3 )); #endregion // anonymous method #region anonymous method delegateShow sd; SD = ( int N1, int N2) => {Console.WriteLine ($ " Anonymous Method Output: {N1 / N2} " );}; SD ( 12 is , . 6 ); #endregion // the lambda #region the lambda GuangChaoshi GW = (n- , B) => { return n-/ B; }; Console.WriteLine ( " the lambda: " + GW ( 99 , . 3 )); #endregion #region generic class Gett <int > ABC = new new Gett < int > (); abc.A = 66 ; abc.B = . 3 ; int JG = abc.GetSum (); Console.WriteLine ( " generic class plus generic method: " + JG) ; #endregion the Console.ReadKey (); } // generic class public class Gett <T> WHERE T: struct { public the TA { GET ; SET ;} public the TB { GET ; SET ;} // generic method public T GetSum () { return ( Dynamic ) A / ( Dynamic ) B; } } } }
These are just a personal understanding, please correct me if wrong