Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Chef chef = new Chef(); //super class

            chef.MakeChicken();
            chef.MakeSpecialDish();                      // makes the basic special dish defined in the Chef.cs super class

            ItalianChef italianchef = new ItalianChef(); // sub class inherits from super class

            italianchef.MakeChicken();
            italianchef.MakePasta();       //can only be run by the sub class with the extra method MakePasta
            italianchef.MakeSpecialDish(); //makes the sub class special dish by the override keyword
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            Chef chef = new Chef();

            chef.MakeChicken();
            chef.MakeSpecialDish();

            ItalianChef italianChef = new ItalianChef();

            italianChef.MakeChicken();
            italianChef.MakePasta();
            italianChef.MakeSpecialDish();
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            Chef chef = new Chef();

            chef.MakeChicken();
            chef.MakesSpecialDish();
            Console.WriteLine();
            ItalianChef italianchef = new ItalianChef();

            italianchef.MakePasta();
            italianchef.MakesSpecialDish();


            Console.ReadLine();
        }