예제 #1
0
        static void Main(string[] args)
        {
            Generics2 <string> g2  = new Generics2 <string>();
            Generics2 <int>    g21 = new Generics2 <int>();

            g2.display("welcome", "guys");
            g21.display(10, 20);
            Console.Read();
        }
예제 #2
0
        static void Main(string[] args)
        {
            //Generic on method
            Generics1 g1     = new Generics1();
            bool      result = g1.Compare <int>(10, 25);

            Console.WriteLine(result);



            Generics2 g2 = new Generics2();

            g2.Add <float>(10.4f, 20.50f);
            g2.Sub <float>(12.25f, 65.0f);


            //Generic on Class
            Generics3 <float> g3 = new Generics3 <float>();

            g3.Add(10.6f, 2.2f);
            g3.Sub(25f, 25.4f);
        }