Example #1
0
        static void Main(string[] args)
        {
            Interface1 i;

            i = new rectangle();
            i.draw();
            i = new circle();
            i.draw();
        }
Example #2
0
        static void Main()
        {
            rectangle r = new rectangle();
            circle    c = new circle();
            area      a;

            a = r;
            Console.WriteLine("\n  ---------------------Program for interface--------------------------");
            Console.WriteLine("\nArea of rectangle is " + a.compute(10, 20));
            a = c;
            Console.WriteLine("\nArea of circle is " + a.compute(10, 0));
            Console.WriteLine("\n  ---------------------End of Program--------------------------");
            Console.ReadLine();
        }