static void Main(string[] args)
        {
            Delete del    = new Delete();
            Del    method = new Del(del.show);

            method();
            hi hi1 = hello;

            Console.WriteLine(hi1("zhangsan"));
            csharp cs1 = delegate(int x) { return("string = " + x); };

            Console.WriteLine(cs1(10));
            csharp cs2 = (int x) => { return("cs2 = " + x); };
            csharp cs3 = x => { return("cs3 = " + x); };

            Console.WriteLine(cs3(123));
        }
Example #2
0
                public static void Main(string[] args)
                {
                    csharp c = new csharp();

                    c.Age();
                    c.For();
                    c.While();
                    c.Message("World");

                    int val = 50;

                    Console.WriteLine("before calling the function   " + val);
                    function f = new function();

                    f.Show(val);
                    Console.WriteLine("After calling the function   " + val + '\n');

                    Console.WriteLine("enter the reference function value:    ");
                    int value = Convert.ToInt32(Console.ReadLine());

                    Console.WriteLine("before calling the reference function   " + value);
                    callByReference reference = new callByReference();

                    reference.reference(ref value);
                    Console.WriteLine("After calling the reference function   " + value + '\n');

                    int    val1    = 50;
                    csharp program = new csharp();

                    Console.WriteLine("Value before passing out variable " + val1);
                    program.outputer(out val1);
                    Console.WriteLine("Value after recieving the out variable " + val1 + '\n');

                    Arrays.Array1d array1D = new Arrays.Array1d();
                    array1D.array();
                }