Ejemplo n.º 1
0
 static int Main(string[] args)
 {
     Bookshelf b1 = new Bookshelf();
     Chair c1 = new Chair();
     b1.Accept();
     b1.Display();
     c1.Accept();
     c1.Display();
     Console.ReadLine();
     return 0;
 }
Ejemplo n.º 2
0
        static int Main(String[] args)
        {
            Bookshelf b1 = new Bookshelf();
            Chair     c1 = new Chair();

            b1.Accept();
            b1.Display();
            c1.Accept();
            c1.Display();

            return(0);
        }
Ejemplo n.º 3
0
        static int Main(string[] args)
        {
            Bookshelf b1 = new Bookshelf();
            Chair     c1 = new Chair();

            b1.Accept();
            b1.Display();
            c1.Accept();
            c1.Display();
            Console.ReadLine();
            return(0);
        }
        static int Main(string[] args)
        {
            Bookshelf b1 = new Bookshelf();
            Chair     c1 = new Chair();

            Console.WriteLine("Furniture Object");
            // Furniture fur1 = new Furniture(); Error--Cannot instatiate an abstract class directly like this

            Furniture fur = new Bookshelf();//We can use a child class to instatiate an Abstract class

            fur.Accept();
            fur.Display();

            //Or
            Console.WriteLine("BookShelf Object");
            b1.Accept();
            b1.Display();


            c1.Accept();
            c1.Display();
            Console.ReadLine();
            return(0);
        }